TGraphAsymmErrors with no horizontal error bar

Dear rooters

I want to plot a TGraphAsymmErrors with no horizontal error bar! So what I do is:

TGraphAsymmErrors*g=myTGraphAsymmErrors(); g->SetFillColor(kBlack); g->Draw(E2);

and yes, it doesn’t draw the horizontal lines of the error bars, but unfortunately the thickness of the line is very small and I don’t know how to control this. Could you please tell me how I control this?
g->SetLineWidth(2); makes nothing to my plot in this case!

any help would be appreciated!


Your question is a bit confusing. You say you do not have to draw the horizontal lines of the Graph with error bars and you are using the option E2 which draws an error box (not error bars). to not draw the horizontal line it is enough to specify the X error equal to zero … well may be that not what you mean.
The simplest would be that you sen a small running example showing what you are doing.

Thanks for your reply! I fear that my question is confusing, now with the root file and the script I’ve prepared I hope my question would be easier to understand.

What I want is that g2 (the black graph) stays with the horizontal error bars and g1 (the red one) no, in my rootlogon.C I’ve set


such that the length of the horizontal error bars is visible!

cheers: zl.
test.root (4.45 KB)
toRoot.C (221 Bytes) (7.68 KB)

   TFile *file = TFile::Open("test.root");


   TExec *ex2 = new TExec("ex2","gStyle->SetEndErrorSize(0);");   
   TExec *ex1 = new TExec("ex1","gStyle->SetEndErrorSize(4);");

Thanks a lot! A little sophisticated way, I’d never would have discovered it my self! It works and I am happy! Thanks again!

Cheers: zl.