Cool histo draw option "E3" also for for TGraphs a

Dear ROOT experts,

For histograms there is this nice feature to draw a fill area between upper and lower error bound. Is this also possible for TGraphs? (TGraphAsymmError)?

Thanks in advance,

Ytsen.

PS. The option “E3” is not recognised and the option “F” fills the entire area below the graph which is neither what I want.

For me this is working:

{
   gROOT->Reset();
   c1 = new TCanvas("c1","A Simple GraphErrors Example",200,10,700,500);
   const Int_t n = 20;
   Double_t x[n], y[n], ex[n], ey[n];
   for (Int_t i=0;i<n;i++) {
     x[i]  = i*0.1;
     y[i]  = 10*sin(x[i]+0.2);
     ex[i] = 0.08;
     ey[i] = 0.1*i;
   }
   gr = new TGraphErrors(n,x,y,ex,ey);
   gr->Draw("A E3");
}

Yes, in root 4.04/02 your code indeed does produce a nice graph with the error area filled black.

But in root 4.00/08 unfortunately the graph is not even drawn! I need to draw a TH2F first for the axes, and then the fill error area is not filled… (see below and see att.)

Apparantly I have to move up. But if someone knows how to create a fill area for TGraphAsymmetricErrorbars then please let me know!

Cheers,

Ytsen.

{
gROOT->Reset();
c1 = new TCanvas(“c1”,“A Simple GraphErrors Example”,200,10,700,500);
const Int_t n = 20;
Double_t x[n], y[n], ex[n], ey[n];
for (Int_t i=0;i<n;i++) {
x[i] = i0.1;
y[i] = 10
sin(x[i]+0.2);
ex[i] = 0.08;
ey[i] = 0.1*i;
}

TH2F h(“h”,“h”, 1, 0, 2, 1, 0, 11);
h.Draw();
gr = new TGraphErrors(n,x,y,ex,ey);

gr->SetFillColor(2);
gr->SetFillStyle(3004);
gr->Draw(“E3”);
}


you should use a more recent version