Painting stats box within a ROOT macro

Hello,

I would like to plot the “statistics box” showing the parameters of a fitted function on a TGraph from within a ROOT macro (i.e. not just right clicking on the TCanvas after the graph has been made.

I know how to do this with RooFit; for example with a RooAbsPdf called pdf you would do

pdf->paramOn(fra, Label(chi2res_char), Format(“NE”));

where fra is a RooPlot.

However, ouside of RooFit, where I have TF1 fitted to a dataset on a TGraph, I cannot find a member function (either of TF1 or TGraph) which does the same job as paramOn().

I tried using the PaintFit member function of TGraph, which looked promising from the description in ther reference manual, but it didn’t do anything.

Can ayone point me to the correct method?

Thanks,

Laurence Carson

I guess you are looking for:

gStyle->SetOptFit(1111);

Yes that does the job.

Thanks very much! :slight_smile:

Laurence