Fit piecewise straight lines joining the points

Hello rooters,

This is a newbie question. I need draw a fit line(function) for the following attached plot (upper side of the plot).
I am not sure how to draw a fit function by joining points.
Piecewise straight lines joining the points
(p, theta)
0.5, 45.
1.5, 45.
3.0, 35.
4.0, 26.
5.0, 20.
7.0, 15.

Any help would be greatly appreciated.

Create a TGraph and then draw it using the “L” drawing option.

Cannot use TF1 for defining a function instead of TGraph?
Thanks
Dil

A set of points jointed by a line is handled by TGraph in ROOT.

https://www.mathsisfun.com/equation_of_line.html
for every pair. Or a TGraph with option “L”, as Wile said.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.