Hi all,
I wrote a little program that generate random numbers and I calculated the covariance and the correlation factor, I compare my values with those calculated by ROOT.
How do I write all these values on the graphic?
Thank you
Ciccio
use a TPaveText object. See examples in tutorials
Rene
Hi,
can I use TPaveText also if I want to print a variable calculated in the program?
If yes, how do I it?
Thank you
Ciccio
see example (and also read the tutorials).
Rene
{
TH1F *h = new TH1F("h","test",100,-3,3);
h->FillRandom("gaus",10000);
TCanvas *c1 = new TCanvas("c1");
h->Draw();
TPaveText *pt = new TPaveText(0.15,0.7,0.30,0.85,"brNDC");
char text[100];
sprintf(text,"mean=%g",h->GetMean());
pt->AddText(text);
sprintf(text,"rms=%g",h->GetRMS());
pt->AddText(text);
pt->Draw();
}
Thank you very much.
Ciccio