[ROOT] Stats box pb

From: Guillaume Blanc (gblanc@hep.saclay.cea.fr)
Date: Wed Dec 11 2002 - 18:21:34 MET


Hi rooters,

I would like to superimpose two TH1 on the same pad and get for each one a
stat box.
I did the folowing to get the regular stat box for the first histogram
(m15), and a second stat box for the second histo (m1517). It works but
the stats of the 1st histo (m15) go into the 2nd stat box and vice versa.

So, what's wrong?

---
  TH1F *m15 = new TH1F("m15","#Delta m_{15}", nbbin, xmin, xmax);
  sn51->Project("m15","dm");
  TH1F *m1517 = new TH1F("m1517","Dm15", nbbin, xmin, xmax);
  sn17->Project("m1517","dm");

  m15->SetStats(kTRUE);
  m15->Draw();

  c1->Update();
  TPaveStats* sta = (TPaveStats*) gPad->GetPrimitive("stats");

  sta->SetName("newname");
  sta->SetX1NDC(0.73);
  sta->SetX2NDC(0.95);
  sta->SetY2NDC(0.70);
  sta->SetY1NDC(0.55);
  sta->SetTextColor(4); // blue

  m1517->SetFillColor(4); // blue
  m1517->Draw("sames"); // print the stats of the 1st histo, m15...

---

If anybody can help me...
(I use  version 3.02/07 on alphacxx6)

		Guillaume Blanc


_________________________________________________________________

    Guillaume BLANC               email: gblanc@cea.fr
    DAPNIA/SPP, CEA Saclay        phone: (33) 1 69 08 85 33
    91191 Gif-sur-Yvette cedex    fax  : (33) 1 69 08 64 28
    France                        web  : http://1.618.free.fr
_________________________________________________________________



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