Skip to content
Snippets Groups Projects
Commit b8b16e23 authored by Rene Brun's avatar Rene Brun
Browse files

Some axis optimisations (time axis in particular) by Damir Buskulic

git-svn-id: http://root.cern.ch/svn/root/trunk@7744 27541ba8-7e3a-0410-8455-c3a389f83636
parent b5d3918d
No related branches found
No related tags found
No related merge requests found
// @(#)root/graf:$Name: $:$Id: TGaxis.cxx,v 1.61 2003/11/25 17:12:30 brun Exp $ // @(#)root/graf:$Name: $:$Id: TGaxis.cxx,v 1.62 2003/11/27 15:15:48 brun Exp $
// Author: Rene Brun, Olivier Couet 12/12/94 // Author: Rene Brun, Olivier Couet 12/12/94
/************************************************************************* /*************************************************************************
...@@ -821,6 +821,10 @@ void TGaxis::PaintAxis(Double_t xmin, Double_t ymin, Double_t xmax, Double_t yma ...@@ -821,6 +821,10 @@ void TGaxis::PaintAxis(Double_t xmin, Double_t ymin, Double_t xmax, Double_t yma
N1A = N1Aold; N1A = N1Aold;
NN1 = NN1old; NN1 = NN1old;
Nticks = NN1; Nticks = NN1;
if (OptionTime) {
wmin += timeoffset - (int)(timeoffset) + rangeOffset;
wmax += timeoffset - (int)(timeoffset) + rangeOffset;
}
} }
} }
......
// @(#)root/hist:$Name: $:$Id: THLimitsFinder.cxx,v 1.6 2003/05/05 09:18:42 brun Exp $ // @(#)root/hist:$Name: $:$Id: THLimitsFinder.cxx,v 1.7 2003/09/30 19:04:39 brun Exp $
// Author: Rene Brun 14/01/2002 // Author: Rene Brun 14/01/2002
/************************************************************************* /*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
...@@ -251,6 +251,7 @@ L20: ...@@ -251,6 +251,7 @@ L20:
else if (sigfig <= 1.5 && jlog==1) siground = 1.5; else if (sigfig <= 1.5 && jlog==1) siground = 1.5;
else if (sigfig <= 2) siground = 2; else if (sigfig <= 2) siground = 2;
else if (sigfig <= 3 && jlog ==1) siground = 3; else if (sigfig <= 3 && jlog ==1) siground = 3;
else if (sigfig <= 5 && sigfig>3 && jlog ==0) siground = 5; //added (Damir in 3.10/02)
else if (jlog==0) {siground = 1; jlog++;} else if (jlog==0) {siground = 1; jlog++;}
else siground = 6; else siground = 6;
break; break;
...@@ -321,22 +322,24 @@ LOK: ...@@ -321,22 +322,24 @@ LOK:
Int_t oldnbins = nbins; Int_t oldnbins = nbins;
Double_t atest = BinWidth*0.0001; Double_t atest = BinWidth*0.0001;
if (TMath::Abs(BinLow-A1) >= atest) { BinLow += BinWidth; nbins--; } //if (TMath::Abs(BinLow-A1) >= atest) { BinLow += BinWidth; nbins--; } //replaced by Damir in 3.10/02
if (TMath::Abs(BinHigh-A2) >= atest) { BinHigh -= BinWidth; nbins--; } //if (TMath::Abs(BinHigh-A2) >= atest) { BinHigh -= BinWidth; nbins--; } //by the next two lines
if (BinLow >= BinHigh) { if (AL-BinLow >= atest) { BinLow += BinWidth; nbins--; }
if (BinHigh-AH >= atest) { BinHigh -= BinWidth; nbins--; }
if (!OptionTime && BinLow >= BinHigh) {
//this case may happen when nbins <=5 //this case may happen when nbins <=5
BinLow = oldBinLow; BinLow = oldBinLow;
BinHigh = oldBinHigh; BinHigh = oldBinHigh;
nbins = oldnbins; nbins = oldnbins;
} }
if (OptionTime && nbins==0) { else if (OptionTime && BinLow>=BinHigh) {
nbins = 2*oldnbins; nbins = 2*oldnbins;
BinHigh = oldBinHigh; BinHigh = oldBinHigh;
BinLow = oldBinLow; BinLow = oldBinLow;
BinWidth = (oldBinHigh - oldBinLow)/nbins; BinWidth = (oldBinHigh - oldBinLow)/nbins;
Double_t atest = BinWidth*0.0001; Double_t atest = BinWidth*0.0001;
if (TMath::Abs(BinLow-A1) >= atest) { BinLow += BinWidth; nbins--; } if (AL-BinLow >= atest) { BinLow += BinWidth; nbins--; }
if (TMath::Abs(BinHigh-A2) >= atest) { BinHigh -= BinWidth; nbins--; } if (BinHigh-AH >= atest) { BinHigh -= BinWidth; nbins--; }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment