Histogram x axis range and statistics box

Hi,

Just a short question… Is it possible to change the range of the x-axis (and the histogram itself) without affecting the statistics such as mean and RMS?

If I call the function SetRange, e.g.

h->GetXaxis()->SetRange(0., 100.),

then the statistics will change according to this new x axis range. Is there a way to avoid this?

Thanks,
Jan

I do not know your exact context and I am not sure this solution will be practical for you, but one thing you can do at the graphic level, is to first draw the x and y scales using:

 c1->DrawFrame(x1, y1,  x2, y2);

and then draw your histogram using the option SAME

Hi,

When setting the range on the axis, the statistics will be automatically updated using only the bins in the histogram range. We would need to add an extra option in the histogram for not updating the statistics when an axis range is set. We will think about whether it is worth implementing this new feature.
For the time being, you should use the work around proposed by Olivier.

Best Regards

Lorenzo

Thanks, I didn’t know whether there was a function or not… Anyhow, I will try to fix it with:

c1->DrawFrame(x1, y1,  x2, y2);

Thanks,
Jan