How to show statbox for stack histogram


I was doing the stack histogram. How do I display the stat box for the final histogram represented by the entire histogram stack?


_ROOT Version:5.34
Platform: Not Provided
Compiler: Not Provided

The “final histogram” does not exist when you draw a stack of histograms. To get such information you will need to add all the histograms in a single one. Then you will be able to get the stats on the total.

Thanks couet! Yes this was my doubt. So after getting the stat information from the added histogram, these(ex:Entries) can be put as text on the stacked histogram canvas.

Use the getters to get Entries etc … and draw them as text using something like

auto Text_Entries = new TText( xpos, ypos, Form("Entries = %g\n", hsum->GetEntries());

And why don’t you simply use my example?

1 Like

Hi Wile,

Thanks! Its working. But there is another outer line coming on the stacked plot. How to avoid this as attached


Oh Sorry! Just removed the L option in drawing. Then only the histograms.


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