TGraph *GetGraph(){ Int_t y[4] = {5,9,8,10}; Int_t x[4] = {1,2,3,4}; TGraph *gr = new TGraph(4,x,y); gr->Draw(); gr->SetDrawOption("AB"); //gr->SetOption("AB"); return gr; } Int_t Test(){ TGraph *fgr = GetGraph(); fgr->Draw(); fgr->Print("AB.png"); }