According to TGraphPainter.html, gStyle->SetErrorX(0) removes drawing of errors along x.
I can get it to work on histograms, but not on graphs with error bars.
See for instance:
Well, it’s common practice to use asymmetric errors only in Y. For instance, you don’t care about X errors when using TGraphAsymmErrors::Divide to get efficiencies with binomial errors from two TH1s.
Could you please consider extending the validity of gStyle->SetErrorX(0) from TGraph to TGraphAsymmErrors in a future release?
I see. To avoid X errors in an efficiency plot from TGraphAsymmErrors::Divide, loop point by point calling SetPointEXlow(i,0) and SetPointEXhigh(i,0). Not elegant, but a solution after all.
I have a use case where I’d like to keep the X error information (I use it to store variable bin widths from which I compute integrals); I would just like not to display it when I make the plot. It would be really neat if gStyle->SetErrorX(0) would do that.
gStyle->SetErrorX() acts on histograms, not on gpaphs. It will be quite confunins if it will have an effte on graph also. You need to make a new graph with errors on X equald to 0.
I confess I am a relative novice with Root, but I note that it was not really obvious to me from the ROOT reference guide that gStyle->SetErrorX() only works on histograms. Comments to the method immediately above it, SetEndErrorSize(), do say that that method works on both TH1 and TGraphErrors.