# How to visualize multiple errorbars for one data set with ErrorListPlot?

I have a following problem:

I am performing error analysis for my data set using multiple technics. Obviously, at the end of my analysis I want to compare the errorbars plotting them on the same graph. However, the best I have got for now is

I really need it to be on one plot and both vertical=( Can Mathematica do that?

• Would you mind posting your entire code instead of a screenshot? Also, I am not quite sure what it is that you want as an end result Oct 8, 2015 at 18:52
• Your question is a bit unclear. You say you want to display multiple error bars and your picture just shows that. And you want it both vertical ... and what? Oct 8, 2015 at 18:55

one idea..

Needs["ErrorBarPlots"]
Show[{ErrorListPlot[
Table[ {{x, Sin[x]},
ErrorBar[RandomVariate[NormalDistribution[.3, .1]],
RandomVariate[NormalDistribution[.1, .1]]]} , {x, 0, 2 Pi, .2}],
ErrorBarFunction ->
Function[{coords, errs}, {Opacity[0.2],
Rectangle[coords + {errs[[1, 1]], errs[[2, 1]]},
coords + {errs[[1, 2]], errs[[2, 2]]}]}]],
ErrorListPlot[
Table[ {{x, Sin[x]},
ErrorBar[RandomVariate[NormalDistribution[.3, .1]],
RandomVariate[NormalDistribution[.1, .1]]]} , {x, 0,
2 Pi, .3}]]}, PlotRange -> All]


Here is an example drawing lines slightly offset:

Needs["ErrorBarPlots"]
offseterror[off_, color_][coords_, errs_] := {color,
Line[{off, 0} + coords + # & /@ Transpose[List @@ errs]]}
Show[{
ErrorListPlot[Table[{{x, Sin[x]},
ErrorBar[RandomVariate[NormalDistribution[.3, .1]]]}, {x, 0,
2 Pi, .3}], ErrorBarFunction -> offseterror[0, Blue]],
ErrorListPlot[Table[{{x, Sin[x]},
ErrorBar[RandomVariate[NormalDistribution[.2, .1]]]}, {x, 0,
2 Pi, .3}], ErrorBarFunction -> offseterror[0.04, Red]]},
PlotRange -> All]


It should be clear how to add the little end bars if you want. I figure it would get too cluttered and you are better off without anyway though.

• Yep, thanks, but that's the same syntax I have used... Oct 12, 2015 at 21:45
• Perfect! Thanks=) Oct 15, 2015 at 2:32