Re: Changing the scale of a histogram

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Wed, 22 Sep 2010 07:50:00 +0200


  double xmin = h->GetXaxis()->GetXmin(); double xmax = h->GetXaxis()->GetXmax();
double factor = 0.001;
h->GetXaxis()->SetLimits(xmin*factor,xmax*factor);

Rene Brun

On 22/09/2010 01:18, suvayu ali wrote:
> Hi everyone,
>
> Is there someway to change the scale of an already existing histogram
> by some constant multiplicative factor? In my case I had a histogram
> with a log X scale in GeV, and I wanted to change it to a log X scale
> in TeV. I have a feeling this is something very trivial but I couldn't
> figure it out and ended up replotting the histogram all over again.
>
> Anyone has any suggestions I can try next time?
>
Received on Wed Sep 22 2010 - 07:50:04 CEST

This archive was generated by hypermail 2.2.0 : Thu Sep 23 2010 - 05:50:01 CEST