How to put multiple lines on the same TGraph

Hi, I need to plot three sets of data each with its own pol1 fit on the same TGraph. I am not sure how to do that. I have the code written for one set of data with a pol1 fit but I don’t know how to combine it. Here is my current code:

{
  g = new TGraph("SST.txt");
  g->SetMarkerStyle(21);
  g->SetLineColor(kRed);
  g->SetTitle("Small Surface Thickness");
  gStyle->SetOptFit(1);
  g->Draw("AP");
  f = new TF1("f","pol1");
  g->Fit(f);
}

TMultiGraph

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