60 else {xmin -= 1; xmax += 1;}
80 Int_t newbinsx,newbinsy;
86 else {xmin -= 1; xmax += 1;}
90 else {ymin -= 1; ymax += 1;}
101 h->
SetBins(newbinsx,xmin,xmax,newbinsy,ymin,ymax);
113 Int_t newbinsx,newbinsy,newbinsz;
120 else {xmin -= 1; xmax += 1;}
124 else {ymin -= 1; ymax += 1;}
128 else {zmin -= 1; zmax += 1;}
143 h->
SetBins(newbinsx,xmin,xmax,newbinsy,ymin,ymax,newbinsz,zmin,zmax);
198 if(strchr(option,
't')) optionTime = 1;
else optionTime = 0;
204 if (al == ah) ah = al+1;
206 if (nold == -1 && BinWidth > 0 )
goto L90;
208 if (ntemp < 1) ntemp = 1;
213 if (awidth >= FLT_MAX)
goto LOK;
214 if (awidth <= 0)
goto LOK;
219 if (optionTime && awidth>=60) {
221 awidth /= 60; timemulti *=60;
225 awidth /= 60; timemulti *= 60;
229 awidth /= 24; timemulti *= 24;
232 if (awidth>=30.43685) {
233 awidth /= 30.43685; timemulti *= 30.43685;
237 awidth /= 12; timemulti *= 12;
247 if (jlog <-200 || jlog > 200) {
254 if (awidth <= 1 && (!optionTime || timemulti==1) ) jlog--;
265 if (sigfig <= 1) siground = 1;
266 else if (sigfig <= 1.5 && jlog==1) siground = 1.5;
267 else if (sigfig <= 2) siground = 2;
268 else if (sigfig <= 3 && jlog ==1) siground = 3;
269 else if (sigfig <= 5 && sigfig>3 && jlog ==0) siground = 5;
270 else if (jlog==0) {siground = 1; jlog++;}
276 if (sigfig <= 1 && jlog==0) siground = 1;
277 else if (sigfig <= 1.2 && jlog==1) siground = 1.2;
278 else if (sigfig <= 2 && jlog==0) siground = 2;
279 else if (sigfig <= 2.4 && jlog==1) siground = 2.4;
280 else if (sigfig <= 3) siground = 3;
281 else if (sigfig <= 6) siground = 6;
282 else if (jlog==0) siground = 12;
288 if (sigfig <= 1 && jlog==0) siground = 1;
289 else if (sigfig <= 1.4 && jlog==1) siground = 1.4;
290 else if (sigfig <= 3 && jlog ==1) siground = 3;
296 if (sigfig <= 1) siground = 1;
297 else if (sigfig <= 2) siground = 2;
298 else if (sigfig <= 5 && (!optionTime || jlog<1)) siground = 5;
299 else if (sigfig <= 6 && optionTime && jlog==1) siground = 6;
300 else {siground = 1; jlog++; }
305 if (optionTime) BinWidth *= timemulti;
314 if (nbins > 10*nold && nbins > 10000) nbins = nold;
320 alb = ah/BinWidth + 1.00001;
325 if (nold == -1)
goto LOK;
327 if (nold > 1 || nbins == 1)
goto LOK;
328 BinWidth = BinWidth*2;
332 if (2*nbins == nold && !optionTime) {ntemp++;
goto L20; }
335 Double_t oldBinLow = BinLow;
336 Double_t oldBinHigh = BinHigh;
337 Int_t oldnbins = nbins;
339 Double_t atest = BinWidth*0.0001;
342 if (al-BinLow >= atest) { BinLow += BinWidth; nbins--; }
343 if (BinHigh-ah >= atest) { BinHigh -= BinWidth; nbins--; }
344 if (!optionTime && BinLow >= BinHigh) {
347 BinHigh = oldBinHigh;
350 else if (optionTime && BinLow>=BinHigh) {
352 BinHigh = oldBinHigh;
354 BinWidth = (oldBinHigh - oldBinLow)/nbins;
355 atest = BinWidth*0.0001;
356 if (al-BinLow >= atest) { BinLow += BinWidth; nbins--; }
357 if (BinHigh-ah >= atest) { BinHigh -= BinWidth; nbins--; }
369 Double_t binlow = 0,binhigh = 0,binwidth=0;
372 if (isInteger) dx = 5*(xmax-
xmin)/nbins;
375 if (umin < 0 && xmin >= 0) umin = 0;
376 if (umax > 0 && xmax <= 0) umax = 0;
380 if (binwidth <= 0 || binwidth > 1.
e+39) {
392 if (xmin < 0 && xmin != dxmin) xmin = dxmin - 1;
394 if (xmax > 0 && xmax != dxmax) xmax = dxmax + 1;
395 else if (xmax ==0 && xmax == dxmax) xmax = 1;
397 if (xmin >= xmax) xmax = xmin+1;
400 nbins =
Int_t((xmax-xmin)/bw);
401 if (xmin +nbins*bw < umax) {nbins++; xmax = xmin +nbins*bw;}
402 if (xmin > umin) {nbins++; xmin = xmax -nbins*bw;}
virtual ~THLimitsFinder()
Class to compute nice axis limits.
virtual void SetBins(Int_t nx, Double_t xmin, Double_t xmax)
Redefine x axis parameters.
static void Optimize(Double_t A1, Double_t A2, Int_t nold, Double_t &BinLow, Double_t &BinHigh, Int_t &nbins, Double_t &BWID, Option_t *option="")
Static function to compute reasonable axis limits.
static THLimitsFinder * GetLimitsFinder()
Return pointer to the current finder.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Short_t Min(Short_t a, Short_t b)
virtual Int_t FindGoodLimits(TH1 *h, Double_t xmin, Double_t xmax)
Compute the best axis limits for the X axis.
static void OptimizeLimits(Int_t nbins, Int_t &newbins, Double_t &xmin, Double_t &xmax, Bool_t isInteger)
Optimize axis limits.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
THashList * GetLabels() const
Double_t Log10(Double_t x)
static void SetLimitsFinder(THLimitsFinder *finder)
This static function can be used to specify a finder derived from THLimitsFinder. ...
Class to manage histogram axis.
THLimitsFinder()
Pointer to hist limits finder.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
static THLimitsFinder * fgLimitsFinder
Short_t Max(Short_t a, Short_t b)
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...