{ TCanvas *c1 = new TCanvas("c1", "c1", 700, 500); c1->SetLogy(); c1->SetGridx(); c1->SetGridy(); TF1 *gdist = new TF1("gdist", "TMath::GammaDist(x, [0], [1], [2])", 0, 10); gdist->SetParameters(0.5, 0., 1.); gdist->SetLineColor(2); TF1 *gdist1 = gdist->DrawCopy("L"); gdist->SetParameters(1.0, 0., 1.); gdist->SetLineColor(3); TF1 *gdist2 = gdist->DrawCopy("LSAME"); gdist->SetParameters(2.0, 0., 1.); gdist->SetLineColor(4); TF1 *gdist3 = gdist->DrawCopy("LSAME"); gdist->SetParameters(5.0, 0., 1.); gdist->SetLineColor(6); TF1 *gdist4 = gdist->DrawCopy("LSAME"); auto legend = new TLegend(0.15, 0.15, 0.5, 0.35); legend->AddEntry(gdist1, "gamma = 0.5, mu = 0, beta = 1", "L"); legend->AddEntry(gdist2, "gamma = 1.0, mu = 0, beta = 1", "L"); legend->AddEntry(gdist3, "gamma = 2.0, mu = 0, beta = 1", "L"); legend->AddEntry(gdist4, "gamma = 5.0, mu = 0, beta = 1", "L"); legend->Draw(); }