Re: [ROOT] problem with TPaveStats::AddText in ROOT 3.04.02

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Jun 12 2003 - 22:09:32 MEST


Hi Franca,

What you do is in principle correct. However, the function
painting the stats box clears the stats box (including your added text)
before drawing it again with the latest histogram parameters.
I have to find a way to avoid this undesirable effect.

Rene Brun

On 
Thu, 12 Jun 
2003, Franca Cassol-Brunner wrote:

> Hello,
> 
> I just moved to root 3.04.02 from root  3.02.07  and my
> scripts don't do anymore what they are supposed to do:
> 
> I want to add some lines to the TPaveStats of my histograms.
> I read that now the stat belong to the histo and I do:
> 
> **********************************
> 
> myHisto->Draw();
> 
> TPaveStats *st =
> (TPaveStats*)histo1->GetListOfFunctions()->FindObject("stats");
> 
> st->AddText("test"); 
> 
> st->Print(); // print to be sure to have added the new line
> 
> st->SetX1NDC(0.3); // move the stat to be sure to re-draw it
> 
> st->SetX2NDC(0.6);
> 
> st->Draw();
> ***************************************************
> 
> The Print() functions shows that the new lines are in the stats,
> but the when the stats is drawn, the new line are not drawn...
> 
> Even if I use the same procedure used for release 3.02.07 ( re-name the
> stat and use TPaveStats* st= (TPaveStats*)gPad->GetPrimitive("stats") )
> the new lines are not more drawn... What should I add miss
> with the new release?
> 
> thanks 
> 
> Franca
> 



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