Statistics box in TH1


I have a problem switching of the statbox for all but one histogram. The only way I found up to now is to make
gStyle->SetOptStat(1) ; and h->SetStats(0) ; for all histos

the other way around

gStyle->SetOptStat(0) ; and h->SetStats(1) ; does not yield the desired effect, e.g. no TPaveStat obejct will be created for the histo.

Any idea, what I do wrong?



Do not call gStyle->SetOptStat, but instead do:

//loop on all hists in current dir TIter next (gDirectory->GetList()); TObject *obj; while ((obj=next())) { if (obj->InheritsFrom("TH1")) ((TH1*)obj)->SetStats(0); } hspecial->SetStats(1111);