Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question
    
Perhaps I should change this into a self answered Q/A? What's the simplest way to plot an ErrorListPlot?:) –  Ajasja Apr 12 '13 at 13:56
    
I agree with the Q/A idea. –  Mr.Wizard Apr 12 '13 at 14:12
    
@Mr.Wizard done –  Ajasja Apr 12 '13 at 14:43

1 Answer 1

up vote 5 down vote accepted

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]

Example error plot

Why this is not documented is beyond me.

share|improve this answer
2  
If you type ??ErrorListPlotyou get the transformation being used: {{ErrorBarPlots`Private`x_?NumericQ, ErrorBarPlots`Private`y_?NumericQ, ErrorBarPlots`Private`e_? NumericQ} :> (ErrorBarPlots`Private`error[ N[{ErrorBarPlots`Private`x, ErrorBarPlots`Private`y}]] = ErrorBar[{0, 0}, {-ErrorBarPlots`Private`e, ErrorBarPlots`Private`e}];` –  belisarius Apr 12 '13 at 17:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.