void combined() { TCanvas *c1= new TCanvas("c1","comparison graph of D0 pT spectra",700,500); const Int_t n1 = 22; const Int_t n2 = 9; Float_t x1[n1] = {0.3898, 1.2052, 2.0008, 2.8163, 3.6117, 4.4272, 5.18298, 6.0183, 6.8337, 7.5895, 8.4049, 9.2203, 10.0159, 10.7916, 11.607, 12.3827, 13.1981, 14.0135, 14.8091, 19.6022, 20.03779, 24.3954}; Float_t y1[n1] = {157.487, 88.3984, 39.3047, 18.1989, 11.0776, 4.9254, 3.5256, 1.95905, 0.9542, 0.4418, 0.3644, 0.1027, 0.1604, 0.07427, 0.08559, 0.03236, 0.02924, 0.06989, 0.01381, 0.00999, 0.02954, 0.008242}; Float_t x2[n2] = {1.5, 2.5, 3.5, 4.5, 5.5, 7,10, 14, 20}; Float_t y2[n2] = {2.65, 1.03, 0.262, 0.0744, 0.0226, 0.00646, 0.00152, 0.000258, 0.0000716}; auto gr1 = new TGraph(n1,x1,y1); auto gr2 = new TGraph(n2,x2,y2); gr1->SetMarkerColor(1); gr2->SetMarkerColor(2); //gr1->SetMarkerStyle(20); // gr2->SetMarkerStyle(20); auto mg = new TMultiGraph(); mg->SetTitle("Comparison graph of D0 pT spectra"); mg->Add(gr1,"AC*"); mg->Add(gr2,"AC*"); mg->Draw("ALP"); }