Sometimes I get really tired of Preparing data for making an ErrorListPlot using Thread
and friends. Is there a simpler way to plot an ErrorListPlot with only y error bars?
Nothing is mentioned in the documentation.
Sometimes I get really tired of Preparing data for making an ErrorListPlot using Thread
and friends. Is there a simpler way to plot an ErrorListPlot with only y error bars?
Nothing is mentioned in the documentation.
Indeed it seems there is a simpler way:
Instead of
ErrorListPlot[{{{x1, y1}, ErrorBar[err1]}, {{x2, y2}, ErrorBar[err2]}, ...}]
Just do
ErrorListPlot[{{x1, y1, dy1}, {x2, y2, dy2} ...}, ...}]
Here is an example:
Needs["ErrorBarPlots`"]
ErrorListPlot[{{1, 2, 0.5}, {3, 4, 0.1}, {5, 6, 0}},
PlotRange -> All, Frame -> True, Axes -> False]
Why this is not documented is beyond me.
??ErrorListPlot
you get the transformation being used: {{ErrorBarPlotsPrivate
x_?NumericQ, ErrorBarPlotsPrivate
y_?NumericQ, ErrorBarPlotsPrivate
e_? NumericQ} :> (ErrorBarPlotsPrivate
error[ N[{ErrorBarPlotsPrivate
x, ErrorBarPlotsPrivate
y}]] = ErrorBar[{0, 0}, {-ErrorBarPlotsPrivate
e, ErrorBarPlotsPrivate
e}];`
$\endgroup$
Commented
Apr 12, 2013 at 17:36