Set colour, line properties to fit of TProfile

Hi,

I am following this example for doing a linear fit to a 2D histogram
root.cern.ch/root/html/tutorials … t2d.C.html
with only modifications to get the fit information with a TFitResultPtr.

What I wanted to know is if there is any way of adjusting the line colour and width of that fit. I saw something about ‘goption’ in the function definition but was not sure if that could solve the problem.

Thanks,
Hardeep

prof->Fit("pol1"); TF1 *f = prof->GetListOfFunctions()->FindObject("pol1"); if (f) { // http://root.cern.ch/root/html/TAttLine.html f->SetLineColor(4); // 4 = "blue" f->SetLineWidth(3); f->SetLineStyle(2); // 2 = "- - -" }

Thank you, that worked perfectly.

Hardeep