# Plot data with different confidence intervals [closed]

I want to plot something like the graph in the figure. I have some points (data) and each of them is associated to two different confidence intervals, at 90% (red) and 95% (blue). These intervals can be asymmetric, as you see in the picture.

I tried to use ErrorListPlot but I don't manage to plot only the x-errors and the results is a mess.

• Please add data to work with and show what you tried so far. Nov 27, 2016 at 18:27

Needs["ErrorBarPlots"]


ErrorBar accepts two arguments:

plot0 = ErrorListPlot[{{{1, 1}, ErrorBar[0.3, 0]}}] which each can be in form of a List to indicate assymetric confidence intervals:

plot1 = ErrorListPlot[{{{1, 1}, ErrorBar[{-0.5, 0.1}, 0]}}] plot2 = ErrorListPlot[{{{1, 1}, ErrorBar[{-0.7, 0.3}, 0]}}, PlotStyle -> Red] You can then just Show two plots together (mind the order):

Show[plot2, plot1] or with a more appealing look by introducing an offset (credit: Bob Hanlon):

Show[plot1 /. {x_?NumericQ, y_?NumericQ} -> {x, y + 0.03},
plot2 /. {x_?NumericQ, y_?NumericQ} -> {x, y - 0.03}] As far as I know, ErrorListPlot isn't very flexible when it comes to styling the points and bars separately (see here and here for custom implementations). I'd combine it simply with a ListPlot:

plot1 = ErrorListPlot[{{{1, 1}, ErrorBar[{-0.5, 0.1}, 0]}},
PlotStyle -> PointSize]
plot2 = ErrorListPlot[{{{1, 1}, ErrorBar[{-0.7, 0.3}, 0]}},
PlotStyle -> {Red, PointSize}]

Show[plot2, plot1,
ListPlot[{{1, 1}}, PlotStyle -> {Black, PointSize[Large]}]]
` 