Re: TAxis strange behaviour

From: Simone Bifani <simone.bifani_at_cern.ch>
Date: Wed, 23 Mar 2011 13:46:31 +0000


  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.

On 23/03/2011 13:42, Olivier Couet wrote:
> One possible way:
>
> hHisto->GetMaximum()*(1+gStyle->GetHistTopMargin());
>
> -----Original Message-----
> From: Simone Bifani
> Sent: Wednesday, March 23, 2011 2:35 PM
> To: Olivier Couet
> Cc: roottalk (Mailing list discussing all aspects of the ROOT system.)
> Subject: Re: [ROOT] TAxis strange behaviour
>
> Hi Olivier,
>
> as far as I know (and I actually just tested) GetMaximum returns the maximum bin content and not the maximum of the y-axis
>
> s.
>
>
> On 23/03/2011 13:30, Olivier Couet wrote:
>> For a 1D histogram you should do:
>>
>> hHisto->GetMaximum()
>>
>>
>>
>> On 3/23/11 2:23 PM, "Simone Bifani"<simone.bifani_at_cern.ch> wrote:
>>
>>> hHisto->GetYaxis()->GetXmax()

Received on Wed Mar 23 2011 - 14:46:38 CET

This archive was generated by hypermail 2.2.0 : Wed Mar 23 2011 - 17:50:01 CET