void PlotMWE(TString part="Test", TString corr="test"){ //In my macro, this function gets called multiple times for different part and corr arguments. TString PARTICLE="Test"; TString VARIABLES[1]={"gDelta"}; const Int_t nVARIABLES=1; UInt_t seasons_Begin[] = { 1, 2, 3}; const Int_t nSeasons = sizeof(seasons_Begin)/sizeof(*seasons_Begin); gStyle->SetTimeOffset(0); //LOOP OVER VARIABLES for(int iVar=0; iVarSetCanvasSize(1300,400); TMultiGraph* graph = new TMultiGraph(); TGraphAsymmErrors* defivgraph=new TGraphAsymmErrors(); defivgraph->SetMarkerColor(kGreen); defivgraph->SetLineColor(kGreen); TGraphAsymmErrors* desixgraph=new TGraphAsymmErrors(); desixgraph->SetMarkerColor(kRed); desixgraph->SetLineColor(kRed); //LOOP OVER SEASONS: for( int iSea=0; iSeaSetPoint( iSea, xf, 1.7); defivgraph->SetPointError(iSea, 0, 0, 1, 0.5); double xs= seasons_Begin[iSea]; desixgraph->SetPoint( iSea, xs, 2); desixgraph->SetPointError(iSea, 0, 0, 1, 0.5); }//END LOOP OVER SEASONS graph->Add(defivgraph); graph->Add(desixgraph); graph->Draw("AP"); canvas->Modified(); canvas->SaveAs( "PlotErrors.pdf", "RECREATE"); }//END LOOP OVER VARIABLES }//END OF FUNCTION