I want to do a linear fit on a TGraphErrors. Attached is the plot I have so far. I want to get rid of the line connecting my datapoints, and instead draw a straight line of best fit though my points.
I have made many attempts but I cant seem to find the correct method. Below is the code that makes the attached plot where l, bb,aa,bbE and aaE are predefined. Does anyone know of any tutorials or how to’s to help me with this linear fitting?
TGraphErrors *gr1 = new TGraphErrors (l, bb, aa, bbE, aaE);
gr1->SetTitle(“Temperature profile along loop”);
gr1->GetYaxis()->SetTitle(“Average Module Temperature C”);
TCanvas c1 = new TCanvas(“c1”,“Tprofile”,100,20,800,400);