i am trying to plot asymmetric yaxis error bars. i have the following code:
import matplotlib.pyplot as plt
a = array([[ 0.5, 1.5],
[ 0.7, 2.2],
[ 2.8, 3.1]])
where each element in the list represents the -yerror, +yerror, like
the documentation for plt.errorbar asks for. when i try to plot this,
i get the following error:
/Library/Python/2.5/site-packages/matplotlib/axes.pyc in vlines(self,
x, ymin, ymax, colors, linestyles, label, **kwargs)
3272 verts = [ ((thisx, thisymin), (thisx, thisymax))
-> 3273 for thisx, (thisymin,
thisymax) in zip(x,Y)]
3274 #print 'creating line collection'
3275 coll = mcoll.LineCollection(verts, colors=colors,
ValueError: too many values to unpack
any idea what's causing this?
the only way it lets me plot is if i do:
plt.errorbar([1,2,3],[1,2,3],yerr=[a[:, 0], a[:, 1]])
which is not the intended result, since the first column in a is the
-yerror and the second is +yerror. does anyone know how to fix this?