Re: Stat & Fit box handling

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Oct 22 1998 - 08:52:15 MEST


Tadeusz Pytlos wrote:
> 
> Dear Rooters,
> I have problems to receive full information
> about my histos, I mean stat box and fit box together.
> The example shows that I succesed only with one.
> How receive stat&fit box in all graphes?
> Thank you in advance,
>                  Tadeusz
> P.S. Sorry for the long example.
> 

Tadeusz,
The "stats" box is only drawn for
 -TH1 objects when TStyle::SetOptStat or TStyle::SetOptFit are set
 -TGraph objects when TStyle::SetOptFit is set

The "stats" box is not drawn for TF1 objects

You can add your own annotations in a TH1, TGraph in two ways:
 - create a TPaveText and draw it on the existing picture
 - more interesting: Create a TPaveText and add it to the list
   of objects to be automatically drawn when drawing a TH1, TGraph.
   This has the additional advantage that the TPaveText (you may have 
   more than one) will be saved together with the TH1,TGraph on a file.
  Example:
    TPaveText *doc = new TPaveText(...);
    doc->AddText("...");
    h->GetListOfFunctions()->Add(doc); //where h is a TH1*
  then, when doing:
    h->Draw();
   the TPaveText object will also be drawn.

Rene Brun



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