Simone,
TAxis hold the bins. On a 1D histogram you have bins only along the X axis.
That's why the Y axis behaves differently, it does not really exist until you plot the histo.
Now the 2nd recipe I gave you works even without plotting the histo.
Olivier
-----Original Message-----
From: Simone Bifani
Sent: Wednesday, March 23, 2011 2:47 PM
To: Olivier Couet
Cc: roottalk (Mailing list discussing all aspects of the ROOT system.)
Subject: Re: [ROOT] TAxis strange behaviour
Hi,
because I need the y-axis maximum to create a TGaxis I did the following to temporary solve this problem
hCL->GetYaxis()->SetRangeUser(1.e-1, 4. * hCL->GetMaximum());
TGaxis *aEta = new TGaxis(hCL->GetXaxis()->GetXmin(),
hCL->GetMaximum(), hCL->GetXaxis()->GetXmax(), hCL->GetMaximum(), 2.,
4.5, 5, "-");
However it seems quite misleading to me that SetRangeUser changes the histogram Maximum but not the YAxis Xmax
Nevertheless I suppose you should check the GetYaxis()->GetXmax() behaviour as I believe it is not working as it should
Thanks,
s. Received on Thu Mar 24 2011 - 10:22:14 CET
This archive was generated by hypermail 2.2.0 : Thu Mar 24 2011 - 17:50:02 CET