/// \file /// \ingroup tutorial_graphs /// \notebook /// Create and Draw a TMultiGraph. /// /// \macro_image /// \macro_code /// /// \author Rene Brun void multigraph() { gStyle->SetOptFit(); auto c1 = new TCanvas("c1","multigraph",700,500); c1->SetGrid(); TMultiGraph *mg = new TMultiGraph(); const Int_t n = 11; TGraph *g[2]; Double_t x[] = {0,1997,3219,3901,3297,2800,2233,1656,1121,802,762}; Double_t x1[] = {9700,8426,7435,6009,3799,3047,2348,1698,1134,805,765}; Double_t y[] = {3,3.5,4,5,8,10,13,18,28,38,40}; int i=0; g[i] = new TGraph(n, x, y); g[i]->SetLineColor(2); g[i]->SetLineWidth(4); g[i]->SetMarkerColor(4); g[i]->SetMarkerStyle(20); mg->Add(g[i]); i++; g[i] = new TGraph(n, x1, y); g[i]->SetLineColor(3); g[i]->SetLineWidth(5); g[i]->SetMarkerColor(5); g[i]->SetMarkerStyle(21); mg->Add(g[i]); mg->SetTitle("; m^{2}_{12};tan#beta"); mg->GetXaxis()->CenterTitle(true); mg->GetYaxis()->CenterTitle(true); // mg->Draw("apl"); mg->Draw("ACP"); //force drawing of canvas to generate the fit TPaveStats c1->Update(); c1->GetFrame()->SetBorderSize(12); c1->Modified(); // c1->RedrawAxis("G"); }