kwd1
January 18, 2006, 4:57pm
1
Hi all,
I’m makking a page with 4 histograms on it and trying to display the stats box on only one of the histograms. I’ve figured out that the following:
c1.Divide(2,2);
c1.cd (1);
gStyle->SetOptStat(10);
h1->Draw();
gStyle->SetOptStat(kFALSE);
c1.cd (2);
h2->Draw();
c1.cd (3);
h3->Draw();
c1.cd (4);
h4->Draw();c1->Print(“histo5.ps (”,“ps”); c1.Clear();
does not work, the first histogram does not display the stats box because of the subsequent gStyle->SetOptStat(kFALSE);
Is there a way to specifu the stats box style locally? I searched around for gPad routines but coundn’t find it.
thanks
Ken
brun
January 18, 2006, 5:02pm
2
Do:
[code]c1.Divide(2,2);
c1.cd (1);
h1->SetStats(10);
h1->Draw();
c1.cd (2);
h2->SetStats(0);
h2->Draw();
c1.cd (3);
h3->SetStats(0);
h3->Draw();
c1.cd (4);
h4->Draw();c1->Print(“histo5.ps (”,“ps”); c1.Clear();[/code]
Rene
kwd1
January 18, 2006, 5:27pm
3
Hi Rene,
I got it to work by:
gStyle->SetOptStat(10);
c1.Divide(2,2);
c1.cd (1);
h1->Draw();
c1.cd (2);
h2->SetStats(0);
h2->Draw();
c1.cd (3);
h3->SetStats(0);
h3->Draw();
c1.cd (4);
h4->Draw();c1->Print(“histo5.ps (”,“ps”); c1.Clear();
Looks like TH1::SetStats(bool) just turns on/off the global stats box.
thanks for the quick help
Ken