//Vẽ đồ thị với các sai số bất đối xứng TGraphAsymmErrors // Báo lỗi chưa chạy được { TCanvas *c1 = new TCanvas("c1", "A simple Graph with asymmetric error bars", 200, 10, 700, 500); c1->SetGrid(); //creat the arrays for the points const Int_t n = 10; Double_t x[n] = {0.22,.05,.25,.35,.5, .61,.7,.85,.89,.95}; Double_t y[n] = {1.,2.9,5.6,7.4,9,9.6,8.7,6.3,4.5,1.}; // creat the arrays with high and low errors Double_t exl[n] = {.05,.1,.07,.07,.04,.05,.06,.07,.08,.05}; Double_t eyl[n] = {.8,.7,.6,.5,.4,.4,.5,.6,.7,.8}; Double_t exh[n] = {.02,.08,.05,.05,.03,.03,.04,.05,.06,.03}; Double_t eyh[n] = {.6,.5,.4,.3,.2,.2,.3,.4,.5,.6}; // creat TGraphAsymmErrors with the arrays gr = new TGraphAsymmErrors(n, x, y, exl, exh, eyl, eyh); gr->SetTitle("TGraphAsymmErrors Example"); gr->SetMarkerColor(4); gr->SetMarkerStyle(21); gr->Draw("ALP"); }