Re: [ROOT] Stat box with THStack?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Nov 19 2002 - 00:01:22 MET


Hi Salvatore,

Currently the "stats" box is disabled for THStack.
You can force the "stats" box to be drawn with:
-case 1: stack drawn with no option (real stack)
  Assuming THStack *hs
  TObjArray *a = hs->GetStack();
  TH1 *h0 = (TH1*)a[0];
  h0->GetPainter(0->PaintStat(1,0); //will paint stats box for 1st hist,

-case 2: stack drawn with option "nostack"
  if TH1 *h1 is one of the histogram in the stack
  h1->GetPainter()->PaintStat(1,0);

These calls should be done after having paint the stack

Rene Brun

On Mon, 18 Nov 2002, Salvatore Rappoccio wrote:

> Hi,
> 
> I was wondering if there is a simple way to put the stat box on a plot 
> with THStack? I have tried gStyle->SetOptStat(111111) before 
> hstack->Draw(), but that doesn't seem to work. Any ideas?
> 
> Sal Rappoccio
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:18 MET