Can we show a fitting function on a plot?

Dear experts:

After we fit some data, we can see the parameters in the terminal.
Can we show the fitting function on a lot, like y=2*x+5, or something.

Thanks a lot.


How do you fit the data? Some of the interfaces will let you add an option to draw the result or you can simply draw the resulting function. For example see $ROOTSYS/tutorials/fit/fithist.C


Thank you so much!



you can get the resulting fitted parameters to an array.

for histograms:
p72. “Access to the Fit Parameters and Results”

it is almost the same for graphs