I find that when I try to plot a histogram using SetLogx() and
SetLimits() for the axis, the actual data are plotted with an offset
equal to the Xmin value I give in the SetLimits() call. E.g. in the
following code I set points at .00001 and .00004, but if I set Xmin
to .00001 they are plotted at .00002 and .00005, or with Xmin set to
0.00005, at .00006 and .00009. This happens with 5.13/04e and also
when I just checked a colleagues installation of 5.17. Plot is at
brunel.ac.uk/~eesridr/logError.ps if I screw up the attachment…
Am I doing something wrong, or is there a bug that’s never been noticed?
#############
from ROOT import gROOT, gStyle, TH1F, TCanvas, TPad, TPaveStats, TLine
a=TH1F(“Test”,“Test”,1000,0.,.001)
a.Fill(0.00001)
a.Fill(0.00004)
c2=TCanvas(“c2”,“c2”,800,800)
c2.Divide(2,2)
c2.cd(1)
a.SetTitle(“Linear Axis”)
a.Draw()
b=a.Clone(“b”)
c2.cd(2)
p=c2.GetPad(2)
p.SetLogx()
b.SetTitle(“Default Log Axis”)
b.Draw()
c=a.Clone(“c”)
c2.cd(3)
p2=c2.GetPad(3)
p2.SetLogx()
c.GetXaxis().SetLimits(.00001,.001)
c.SetTitle(“Log Axis, min=0.00001”)
c.Draw()
d=a.Clone(“d”)
c2.cd(4)
p3=c2.GetPad(4)
p3.SetLogx()
d.GetXaxis().SetLimits(.00005,.001)
d.SetTitle(“Log Axis, min=0.00005”)
d.Draw()
c2.Update()
c2.Print(“logError.ps”)
logError.ps (23.6 KB)