[Root_list] TAxis

Carlos Ayerbe-Gayoso gayoso at jlab.org
Mon Sep 16 18:53:18 EDT 2013


Thank you David, but I'm not looking for any rebinning. Just take a 
histogram with original limits -20,20 and just cut them to -15,15.

I know I could do it from the beginning (when I create the histogram) 
but I wonder why SetLimits changed the, I think it is, the size

I attached two plots, so you can see the "problem".

It is not a big deal for me now. I can change the constructor of the 
histogram and solve it, but I was curious about it, and I didn't find 
any references.

Thank you again

Carlos

El 9/16/2013 6:40 PM, David Lawrence escribió:
> 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
> _______________________________________________
> Root_list mailing list
> Root_list at jlab.org
> https://mailman.jlab.org/mailman/listinfo/root_list

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mod_zoom.png
Type: image/png
Size: 30037 bytes
Desc: not available
Url : https://mailman.jlab.org/pipermail/root_list/attachments/20130916/4dc818af/attachment-0002.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ori_zoom.png
Type: image/png
Size: 18083 bytes
Desc: not available
Url : https://mailman.jlab.org/pipermail/root_list/attachments/20130916/4dc818af/attachment-0003.png 


More information about the Root_list mailing list