Print Parameters into Legend

I’ve just started doing things with ROOT.

So far I was able to figure out how to import, plot and fit my data.
But there is a point where I got stuck:
I want to print the parameters of the linear fit (the slope, the y-intercept and their errors) to the TLegend, but I wasn’t able to figure out how.

I’m shure that You can help me in this case!

Thank You in advance!

Severin Bang

You should use the option Fit.

I use

with fj1 are my xy-data, and fitfja is the defined linear Fitfunction. Meanwhile, i use gStyle->SetOptFit(00001); to print some Parameters. But i would prefer an option to Print the Parameter as a part of the TLegend.

Thank you in advance!


Tlegend is not meant to print fir parameter you should use

okey. in this case im doing it right. Thank you.