{ gROOT->Reset(); gStyle->SetOptStat(1111111); gStyle->SetOptFit(1111); c1 = new TCanvas("c1","gerrors2",0,0,500,500); Int_t n = 3; Float_t x[] = {2.,4.,6.}; Float_t y[] = {2.,4.,6.}; Float_t ex[] = {0.,0.,0.}; Float_t ey[] = {0.,0.,0.}; gr = new TGraphErrors(n,x,y,ex,ey); func = new TF1("func","[0]*x+[1]"); gr.Fit("func"); gr->Draw("A*"); }