Stats box and Draw("same")

From: Anthony Faust (afaust@dres.dnd.ca)
Date: Thu Dec 16 1999 - 23:13:32 MET


	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



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