[Root_list] TAxis
David Lawrence
davidl at jlab.org
Mon Sep 16 18:40:22 EDT 2013
Hi Carlos,
I believe the purpose of the SetLimits method is to change the units
of the x-axis for display without actually changing the contents of the
histogram. To rebin, you would need to use one of the Rebin methods of
TH1D. Note that this is intended to reduce the number of bins by adding
multiple bins from the original histogram into the one bin of the new
histogram. If you want to rebin in a way that differs from that, you
should redefine the histogram at its source and re-fill it. It is done
this way since Information is lost as you fill a histogram. Any other
type of rebinning could lead to odd effects that may be misleading.
Regards,
-David
On 9/16/13 6:31 PM, Carlos Ayerbe-Gayoso wrote:
> Dear rooters
>
> I noticed that a histogram, stored in a root file, if is read by a macro
> and the limits are changed via TAxis, the "size" of the bins change.
>
> Taxis *axis_1 = hXcg->GetXaxis();
> axis_1->SetLimits(-15.,15.);
>
> Let's say that if the lower bin with data, in the original histogram, is
> at -6, after the SetLimits option, the lower bin is around -5.
>
> Does it happen to you? The shape of the histogram is the same, so no
> rebinning happen before.
>
> Thank you for your feedback
>
> Carlos
> _______________________________________________
> Root_list mailing list
> Root_list at jlab.org
> https://mailman.jlab.org/mailman/listinfo/root_list
More information about the Root_list
mailing list