Hi Everyone,
I just stumbled about a strange artefact while working with TGaxis. When I plot a new axis, the exponent is wrong, if i do SetMaxDigits. I have a minimal Example, showing the different exponents with and without the line " ROOT.TGaxis.SetMaxDigits(1)". Any ideas?
Cheers,
Daniel
import ROOT
def main():
xMin = -5
xMax = 5
hist = ROOT.TH1F("hist","hist",100,xMin,xMax)
gaus = ROOT.TF1("g","gaus",xMin,xMax)
gaus.SetParameters(1,2,3)
hist.FillRandom("g")
c = ROOT.TCanvas()
frameHist = c.DrawFrame(xMin,0,xMax,100,"ASDF")
#Commenting this in makes problems!!!
#ROOT.TGaxis.SetMaxDigits(1)
axis = frameHist.GetYaxis()
axis.SetLabelOffset(999)
axis.SetTickLength(0)
uYMin = ROOT.gPad.GetUymin()
uYMax = ROOT.gPad.GetUymax()
uXMin = ROOT.gPad.GetUxmin()
uXMax = ROOT.gPad.GetUxmin()
axisFun = ROOT.TF1("axisFun","-x",0,100);
newAxis = ROOT.TGaxis( uXMin,
uYMin,
uXMax,
uYMax,
"axisFun",
)
newAxis.Draw("Same")
hist.Draw("Samehist")
c.Update()
raw_input()
if __name__ == "__main__":
main()