Re: [ROOT] Two problems

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Nov 21 2003 - 09:08:30 MET


Hi Bernard,

Bernard Andrieu wrote:
> 
> Dear Rene,
> 
> thanks for your answers. I have a few further questions.
> 
> Rene Brun a écrit :
> >
> > Hi Bernard,
> >
> > Bernard Andrieu wrote:
> > >
> > > Hello,
> > >
> > > I have two problems with root.
> > >
> > > Problem 1:
> > >
> > > I want to display an histogram with just its name in the stat box. According to
> > > the manual, I should be able to do that with:
> > >
> > > gStyle->SetOptStat(1);
> > >
> > > but the stat box still displays, in addition to the name,  Entries, Mean and
> > > RMS.
> > > Note that this problem is specific to the value 1 as an argument (with 0, 10,
> > > 11, and so on, it works as expected).
> >
> > 1 is a special case setting the default options. The workaround is to call
> >   gStyle->SetOptFit(10000001);
> >
> Do you mean this is a special case for all option settings? May I suggest to
> document it clearly in all relevant places, e.g. in the Users Guide p.32?

This missing information has already been added in the code and documentation
for the current version in CVS. See:
  http://root.cern.ch/root/htmldoc/TStyle.html#TStyle:SetOptStat
  See the two functions:
     void SetOptStat(Int_t mode) 
     void SetOptStat(Option_t *stat) 

> 
> > >
> > > Problem 2:
 >
> Although I don't understand the (presumably good) reasons behind these features
> of the program, may I then suggest to add a new functionality that would allow
> the TPaveStats... command to be executed WITHOUT the histogram being actually
> drawn?

Not possible. The TPaveStats makes sense only when associated with a histogram.
Painting the 'stats" box is an action within the histogram painting function.
And I cannot understand the rationale behind your request.

> 
> This is actually what I want to do, because, as you can imagine, I'm interested
> in having the histogram displayed only when the position of the stat box has
> been correctly defined.

Why? The position of the stats box is independent of the histogram coordinates
and contents. Its position is expressed in NDC. You can use the TStyle
functions to control the default position and size.
see TStyle::SetStatH,X,Y,W.

Rene Brun

> 
> Thanks for help.
> --
>                       Best regards,
>                                Bernard Andrieu
> -----------------------------------------------------------------------
>                          ("-/")_.-'"-._
> LPNHE, 4 pl. Jussieu      . . ; -._    )-;-,_)  email: andrieu@in2p3.fr
>     Tour 33, RdC         (v_,)'  _  )-.\  -'    Tel: +33 (0)1 4427 2321
> 75252 PARIS CEDEX 05    _.- _..-_/ / ((.'       Fax: +33 (0)1 4427 4638
>                       ((,.-'   ((,/
> -----------------------------------------------------------------------



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:17 MET