Re: Stats box and Draw("same")

From: Otto Schaile (Otto.Schaile@Physik.uni-muenchen.de)
Date: Fri Dec 17 1999 - 09:20:31 MET


Hi Anthony,
you can do the same thing Rene proposed in a responce to Matt Dobbs:

Date: Mon, 13 Dec 1999 14:57:01 +0000
From: Rene Brun <Rene.Brun@cern.ch>
To: Matt Dobbs <Matthew.Adam.Dobbs@cern.ch>


  TPaveStats *st1 = (TPaveStats*)gPad->GetPrimitive("stats");
  st1->SetName("stats1")

i.e. rename the existing box so its conserved.

Cheers
Otto

On Thu, 16 Dec 1999, Anthony Faust wrote:

> 
> 	Another email with the same subject went out a few months ago but there 
> was no answer published to the group, so I thought I would try it again as it is 
> something I am also interested in.
> 	
> 	How does one plot two or three histograms in the same
> frame (using Draw("same")) and get the statistics box for all histograms? 
> I tried to replicate the relevent parts for THistPainter but could not get this 
> to work.
> 
> 	Another more drastic option would be to change the conditional in 
> THistPainter::Paint
> 	
> if (!Hoption.Same) {
>       TF1 *fit = (TF1*)fFunctions->First();
>       if (!fH->TestBit(TH1::kNoStats)) {  // bit set via TH1::SetStats
>          PaintStat(gStyle->GetOptStat(),fit);
>       }
>    }
> 
> to make showing all stats boxes the default behaviour, set with TH1::kNoStats,
> 
> if ( !fH->TestBit(TH1::kNoStats) ) { // bit set via TH1::SetStats
>       TF1 *fit = (TF1*)fFunctions->First();
>       PaintStat(gStyle->GetOptStat(),fit);
>    }
> 
> and have these TNamed objects created with unique names, such as hist1stat, 
> hist2stat, etc., which could then be accessed by a mouse click on the histogram 
> or other user code.
> 	
> _____________
> Dr. Anthony A. Faust                            | Anthony.Faust@dres.dnd.ca
> Defence Research Establishment Suffield         | PH:  (403) 544-5362
> Box 4000, Medicine Hat, Alberta, CANADA T1A 8K6 | FAX: (403) 544-4704
> 

----------------------------------------------------------------------------
Otto Schaile                    Sektion Physik der LMU Muenchen
Phone: (+49 89)289 14070        Am Coulombwall 1, D-85748 Garching, Germany
FAX:   (+49 89)289 14072        EMail: Otto.Schaile@Physik.Uni-Muenchen.DE



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:44 MET