Error bars in matplotlib
Posted on 2011-09-13
I would like to plot a graph with errors bars.
Suppose, for example, that my x and y values are
x = (0,1,2,3) and y = (4,7,2,10)
I can plot this using
However, what I want to do now is to display some error bars on these points.For example, for the point at x = 0, the y value may not be exactly y=4 and may be a minimum of 3.6 and a maximum of 4.2.
I could like to draw a vertical line between these limits and also write the 3.6 and 4.2 labels on the line (other points would have different errors and labels).
Can anybody tell me how to do this?
Thanks in advance