void comp() { c1 = new TCanvas ("c1","comp", 200,10,700,500); c1->SetGrid(); TMultiGraph *mg = new TMultiGraph(); mg->SetTitle("comp"); gr1 = new TGraph("pkppontsprod7"); gr1->SetMarkerStyle(7); gr1->SetFillColor(3); gr1->SetLineColor(1); gr2 = new TGraph("ptotprod7"); Float_t rightmax = 1.1*gr2->GetMaximum(); Float_t scale = gPad->GetUymax()/rightmax; gr2->Scale(scale); gr2->Draw("same"); gr2->SetMarkerStyle(7); gr2->SetFillColor(3); gr2->SetLineColor(2); mg->Add(gr1); mg->Add(gr2); mg->Draw("ALP"); TGaxis*axis = new TGaxis(gPad->GetUxmax(),gPad->GetUymin(), gPad->GetUxmax(),gPad->GetUymax(), 0,rightmax,510,"+L"); axis->SetLineColor(kRed); axis->SetLabelColor(kRed); axis->Draw(); mg->GetXaxis()->SetTitle("Tape number"); mg->GetYaxis()->SetTitle("Mean [GeV]"); leg = new TLegend(.75,.80,.95,.55); leg->SetFillColor(0); leg->SetTextSize(0.036); leg->AddEntry(gr1,"prod7","l"); leg->AddEntry(gr2,"prod9","l"); leg->Draw(); }