TH1::Integral("width") in TPaveStats (statbox)

Hi there,

Attached’s a patch to display TH1::Integral(“width”) instead of TH1::Integral() in TPaveStats (git diff against trunk rev f9e6c8dcedff7cfd4ab3531b4a960128ea1e41c2).
It introduces the option “I”=2 (the default one remains “i”=1):

{ TH1D * histo1D = new TH1D ("histo1D","",2,0.,4.) ; histo1D->SetBinContent( 1,1.) ; histo1D->SetBinContent( 2,2.) ; TCanvas * canvas = new TCanvas () ; canvas->Divide(2,1) ; canvas->cd(1) ; gStyle->SetOptStat("nemruoi") ; histo1D->DrawClone() ; canvas->cd(2) ; gStyle->SetOptStat("nemruoI") ; histo1D->DrawClone() ; }
Could this (or any better version) please be committed to the trunk?

Cheers,
Z
TStyle.cxx.diff (514 Bytes)
THistPainter.cxx.diff (901 Bytes)

I’ll check with Lorenzo and apply it if he agrees.

Ok, thanks.
Have a nice meeting :wink:
Z

One thing which is missing is your diff files is the documentation update in TStyle::SetOptStat headers.

Hi Mathieu,

just spoke with Lorenzo. Your patch is fine. Only is missing the doc.
Can you provide it in your diff ?

Olivier

One more thing. When you use “I” instead of “i” there no changes on the Stats display showing that you have used one or the other. I am not sure that’s a good thing.

[quote]When you use “I” instead of “i” there no changes on the Stats display showing that you have used one or the other.[/quote]So let’s introduce it. Among first ideas comingIntegral* Integral*x Integral_BW Integral(BW) Integral_W Integral(W) Integral_w Integral(w) Integral("width") Integral\times#DeltaXI propose “Integral(w)” as a default.
As usual the best is to let the end user choose.
Hence a new entry in $ROOTSYS/etc/system.rootrc (.rootrc): Hist.Stats.IntegralBinWidth: Integral(w)

[quote]Only is missing the doc. Can you provide it in your diff ?[/quote]See the diff files below (same trunk rev as above, TStyle.cxx.2.diff = TStyle.cxx.diff provided not to forget it). Feature above documented.

Cheers,
Z
THistPainter.cxx.2.diff (5.99 KB)
TStyle.cxx.2.diff (514 Bytes)

Now in place. Thanks !

Thx Olivier.
CU around,
Z

Hi Olivier,
Some comments were missing.
Git diff against master branch 06ba34699dfd5a8f7c898f9371984837a52f334d.
See ya,
Z
TStyle.cxx.3.diff (892 Bytes)

Thanks.
Now in place