Zooming in TBrowser changes Mean value in statistics

ROOT Version: 6.14/06
Platform: Scientific Linux 7 x64_x86
Compiler: gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)

Hi all!
I found weird changing of mean value of histogram in statistic while zooming in.

I have histos saved in root file. If I open TBrowser to check one of them I can see:

And if I try to scale X axis:

Mean value automatically changes for 0.5. Even if there is no data, or if I zoom to the same amount of bins (not zooming at all).

I see this behavior in most of histograms in my file. Except energy ones (maybe because there much more bins for the given interval?)

Did somebody faced this?



Hi Bohdan,

When drawing histogram without zooming, accumulated statistic is used to calculate mean - you see so to say “true” mean value. When you zoom histogram, mean value calculated based on bin content and bin position, which can differ from real values.


…and when you zoom back, the accumulated statistic is lost.
So the first value you see is the most accurate, based on the actual values inserted in the histogram, and the following values are approximations based on bin center positions.

1 Like

Also see https://sft.its.cern.ch/jira/browse/ROOT-8901

Hi Enrico,

When you calling TAxis::UnZoom(), user range selection is reset and you will see original values again.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.