I couldn’t find an answer to the problem of Franca which was posted some time ago (I added the thread at the end).
Is there a way now to add some custom text lines to a TPaveStats of an histogram?
Thanks for the answer!
Re: [ROOT] problem with TPaveStats::AddText in ROOT 3.04.02
From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Jun 12 2003 - 22:09:32 MEST
* Next message: Rene Brun: "Re: [ROOT] Retrieve the formula expression from a TFormula"
* Previous message: Rene Brun: "Re: [ROOT] Embedding root"
* In reply to: Franca Cassol-Brunner: "[ROOT] problem with TPaveStats::AddText in ROOT 3.04.02"
* Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
What you do is in principle correct. However, the function
painting the stats box clears the stats box (including your added text)
before drawing it again with the latest histogram parameters.
I have to find a way to avoid this undesirable effect.
Thu, 12 Jun
2003, Franca Cassol-Brunner wrote:
I just moved to root 3.04.02 from root 3.02.07 and my
scripts don’t do anymore what they are supposed to do:
I want to add some lines to the TPaveStats of my histograms.
I read that now the stat belong to the histo and I do:
TPaveStats st =
st->Print(); // print to be sure to have added the new line
st->SetX1NDC(0.3); // move the stat to be sure to re-draw it
The Print() functions shows that the new lines are in the stats,
but the when the stats is drawn, the new line are not drawn…
Even if I use the same procedure used for release 3.02.07 ( re-name the
stat and use TPaveStats* st= (TPaveStats*)gPad->GetPrimitive(“stats”) )
the new lines are not more drawn… What should I add miss
with the new release?
unfortunately I still have this problem,
I’m using TGraph and not TH1F, and solution you proposed does not work for me
For the timebeing I just added another TPaveText object with my additional text,
but would be nice to have it in the statistics box