my question concerns the displayed mean in the stats box of a 1D histogram. I have two histograms displayed on 1 page. The two means are displayed by default as .001234 and 1.234
It seems to display 4 decimal places of accuracy. I’d like to turn that down to 2.
I used:
gStyle->SetStatFormat(“6.4”)
This displays the first mean as .0012, but the other stats box fields (overflow, underflow) now become: xx.0000, and the second mean becomes 1.2345. If I use a second SetStatFormat command before plotting the second histogram, it seems to go back and change the format on the first histogram.
Is there a way to set just the mean on a histogram by histogram basis?
many thanks
Ken
Try (note -> “gStyle” is a “global” which points to the “current style”):
gStyle->SetStatFormat(“6.2g”); // maximum 2 significant digits
Note also -> once you draw something and its “stats” box appears (“gPad->Modified(); gPad->Update();” is mandatory), you can change its appearance using the methods of the TPaveStats class (so you can change each “stats” box individually).