{ //---------------------------------------------------------------------------------- Data_Set-A ------------------------------------------------------------------------------------------- Int_t n_3 = 4; //Double_t x_3[4] = {33.347, 32.859, 26.337, 23.311}; Double_t x_3[4] = {77.245, 65.692, 54.140, 44.2840}; Double_t y_3[4] = {122.4, 121.1, 120.3, 119.1}; Double_t ex_3[4] = {0, 0, 0,0}; Double_t ey_3[4] = {0.02985, 0.02912, 0.04814, 0.2272}; TGraphErrors *gau_tri = new TGraphErrors(n_3,x_3,y_3,ex_3,ey_3); gau_tri->SetTitle("Data_Set-A"); gau_tri->SetMarkerColor(2); gau_tri->SetLineColor(2); gau_tri->SetLineWidth(1); gau_tri->SetMarkerSize(1.6); gau_tri->SetMarkerStyle(8); gau_tri->SetDrawOption("AP"); //---------------------------------------------------------------------------------- Data_Set-B ------------------------------------------------------------------------------------------ Int_t n_23 = 6; Double_t x_23[6] = {35, 40, 45, 50, 55, 60}; Double_t y_23[6] = {118.808, 119.300, 120.117, 120.362, 120.828, 121.054}; TGraph *gau23 = new TGraph(n_23,x_23,y_23); gau23->SetTitle("Data_Set-B"); gau23->SetLineStyle(9); gau23->SetLineWidth(1); gau23->SetLineColor(2); gau23->SetDrawOption("C"); //---------------------------------------------------------------------------------- Data_Set-C ------------------------------------------------------------------------------------------- Int_t n_31 = 4; Double_t x_31[4] = {33.347, 32.859, 26.337, 23.311}; Double_t y_31[4] = {121.113, 121.25, 120.113, 119.119}; TGraph *gau_tri1 = new TGraph(n_31,x_31,y_31); gau_tri1->SetTitle("Data_Set-C"); gau_tri1->SetLineStyle(2); gau_tri1->SetLineWidth(1); gau_tri1->SetLineColor(2); gau_tri1->SetDrawOption("C"); //---------------------------------------------------------------------------------- Data_Set-D -------------------------------------------------------------------------------------------------------------- Int_t n_1 = 3; Double_t x_1[3] = {70.7, 59.1, 47.5}; Double_t y_1[3] = {122.3, 120.8, 119.6}; Double_t ex_1[3] = {0, 0, 0}; Double_t ey_1[3] = {0.0536, 0.03264, 0.0569}; TGraphErrors *gir = new TGraphErrors(n_1,x_1,y_1,ex_1,ey_1); gir->SetTitle("Data_Set-D"); gir->SetMarkerColor(1); gir->SetLineColor(1); gir->SetMarkerSize(1.6); gir->SetLineWidth(1); gir->SetMarkerStyle(71); gir->SetDrawOption("AP"); // for Data set A & C, I dont want to join the lines between the markers, but want to have the error bars plotted TCanvas *c11 = new TCanvas("c11","c11_Paper",800,500); c11->cd(); TMultiGraph *mg = new TMultiGraph(); mg->Add(gau23); mg->Add(gau_tri); mg->Add(gau_tri1); mg->Add(gir); mg->GetXaxis()->SetLimits(0,90); //mg->GetYaxis()->SetLimits(100., 150.); mg->Draw("APL"); //c11->BuildLegend(); c11->Update(); }