hi all,

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]])
plt.errorbar([1,2,3],[1,2,3],yerr=a)

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)
   3271
   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?

thank you.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to