Re: Fast copy of axis attributes of a histogram

From: Vassili Maroussov <Vassili.Maroussov_at_cern.ch>
Date: Thu, 21 Feb 2008 21:06:45 +0100


Thank you Otto.

Perhaps, after TAxis::ImportAttributes(const TAxis *axis) I have to call TH1F::SetBinsLength()? Or TH1 will check automatically that size of the data buffer corresponds to TAxis::GetNbins()? Should I do something else?

Cheers,

Vassili

Otto Schaile wrote:
> Hi Vassili,
> see:
> http://root.cern.ch/root/html/TAxis.html#TAxis:ImportAttributes
> Cheers
> Otto
>
> Vassili Maroussov wrote:
>> Dear ROOTers,
>>
>> I'm wondering whether there is a fast way to copy all attributes
>> (number of bins, title, etc.) of an axis of one histogram to an axis
>> of another. A mean, something like
>>
>> TH2F hist1(...);
>> TH1F hist2(...);
>>
>> *(hist2.GetXaxis()) = *(hist1.GetYaxis());
>>
>> Is the operation above correct or in general it creates a corrupted
>> histogram with an improper set number of bins?
>>
>> Regards,
>>
>> Vassili
>>
>>
>
>
Received on Thu Feb 21 2008 - 21:06:51 CET

This archive was generated by hypermail 2.2.0 : Thu Feb 21 2008 - 23:50:02 CET