Re: Scaling xaxis of a histogram

From: Olivier Couet <Olivier.Couet_at_cern.ch>
Date: Fri, 9 Sep 2011 08:40:19 +0000


Hi,
I think the best is to make a new histogram with these rescaled X values. May be Lorenzo has a better idea ?
Cheers,
Olivier

---
Org:    CERN - European Laboratory for Particle Physics.
Mail:   1211 Geneve 23 - Switzerland                     Mailbox: J25910
E-Mail: Olivier.Couet_at_cern.ch<mailto:Olivier.Couet_at_cern.ch>                            Phone:   +41 22 7676522
WWW:    http://cern.ch/Olivier.Couet/                    Fax:     +41 22 7670300


On Sep 9, 2011, at 12:46 AM, Aamer Wali Rauf wrote:

Hi,

Is there a way to do the following:

Suppose I have a histograms having 100 bins with x-axis from bin number 1 to 100. I find the mean (weighted) of the histogram using mean = histo->GetMean(). Now I want my x-axis as (original_x_axis/mean). This obviously leaves y-axis but rescales the x-axis having now 100 bins perhaps in 1 to 10 range rather than in 1-100 range.

I tried to find if I could put histogram into ntuple with two columns, then divided the x column by the mean and redraw the histogram. But I could not find any such thing.

Thanks,
Aamer
Received on Fri Sep 09 2011 - 10:40:27 CEST

This archive was generated by hypermail 2.2.0 : Sat Sep 10 2011 - 23:50:01 CEST