[ROOT] Renaming the stats box

From: Jon Levell (jonathan.levell@cern.ch)
Date: Mon Aug 28 2000 - 15:17:15 MEST


Hi.

I'm trying to overlay two histograms in the same pad. Before drawing the 
second histogram (using sames) I first want to rename and move the stats
box for the first histogram. If I do this when the pad is updated I
have the stats box drawn in both the old and new positions. If I don't
rename it then when I move the stats box, the old version dissappears
correctly:

{
TH1 *hist;
TPaveStats *statsbox;

TFile f1("1.root");

hist = (TH1 *)f1.Get("h1001");
hist->Draw();
gPad->Update();

statsbox=(TPaveStats *)(gPad->GetPrimitive("stats"));
statsbox->SetX1NDC(0.78);
statsbox->SetX2NDC(0.98);
statsbox->SetY1NDC(0.5);
statsbox->SetY2NDC(0.85);
statsbox->SetName("h1001stats");

gPad->Draw();
}

I'm using the normal version of ROOT installed here at CERN, what
am I doing wrong?

Thanks for pointing out my stupid mistake...

Jon.



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:32 MET