Re: [ROOT] Problem with SetOptFit and SetOptStat in v3_03/07 and v3_03/09

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Oct 17 2002 - 22:19:03 MEST


Hi Robert,

gStyle->SetOptStat or gStyle->SetOptFit can be used to change the default
option that will be used to create the TPaveStats object when painting
a TH1 or a TGraph. Once the TPaveStats object is created, it is added
to the histogram list of functions. Next time the TH1 is redrawn,
the existing TPaveStats object is drawn with its current properties that
you can modify via TPaveStats::SetOptStat and SetOptFit (via the context
menu or C++). This feature is new in 3.03/09 and it allows to easily keep
a TPaveStats for more than one histogram displayed in the pad. See the
3.03/09 release notes at section "New Options in THistPainter" at:
http://root.cern.ch/root/htmldoc/examples/Version303.news.html
or at:
http://root.cern.ch/root/htmldoc/THistPainter.html#THistPainter:Paint

To access the "stats" box, do:
 TPaveStats *st =
(TPaveStats*)h->GetListOfFunctions()->FindObject("stats");
 h->SetOptStat(11); //for example

Rene Brun

On Wed, 16 Oct 2002, Robert Harris wrote:

> Dear RootTalk,
> 
> In v3_03/07 and v3_03/09 when I try to print fit statistics on the histogram using
>  gStyle->SetOptFit(1011)
> 
> or change the content of the statistics printout using 
>  gStyle->SetOptStat(11);
> 
> there is *no* change to the printed histogram.  The box always contains the
> histogram name, number of entries, mean and RMS regardless of what I do.
> 
> However, both the above commands work in v3_02/06.  For version v3_02/06 
> I can get fit parameters printed and I can change the content of the statistics box to 
> include only the name and number of entries.
> 
> Specifically, I am using Fermilab version v3_03_09a, v3_03_07c, and v3_02_06b.
> 
> Is there some other way I am supposed to change the statistics and fit printing 
> on the histograms in the more recent versions of root?
> 
> Thanks,
> Robert
> 



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