python - matplotlib.pyplot.errorbar is throwing an error it shouldn't? -


i'm trying make errorbar plot data. x 9 element ndarray. y , yerr 9x5 ndarrays. when call:

matplotlib.pyplot.errorbar(x, y, yerr) 

i valueerror: "yerr must scalar, same dimensions y, or 2xn."

but y.shape == yerr.shape true.

i'm running on 64 bit windows 7 spyder 2.3.8 , python 3.5.1. matplotlib date. i've installed visual c++ redistributable visual studio 2015.

any ideas?

edit: data.

x=numpy.array([1,2,3]) y=numpy.array([[1,5,2],[3,6,4],[9,3,7]]) yerr=numpy.ones_like(y) 

maybe "dimension of y" docs meant 1xn...

anyway, work:

for y, yerr in zip(y, yerr):     matplotlib.pyplot.errorbar(x, y, yerr) 

Comments