[英]3-D Quiver Plot in Python
我正在尝试在python 2.7中制作3-D颤动图。 当我从matplotlib网站运行quiver3d_demo.py时,出现如下所示的值错误:
--------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/Library/Python/2.7/site-packages/ipython-2.0.0_dev-py2.7.egg/IPython/utils/py3compat.pyc in execfile(fname, *where)
202 else:
203 filename = fname
--> 204 __builtin__.execfile(filename, *where)
/Users/loisks/Desktop/quiver3d_demo.py in <module>()
15 np.sin(np.pi * z))
16
---> 17 ax.quiver(x, y, z, u, v, w, length=0.1)
18
19 plt.show()
/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.8-intel.egg/matplotlib/axes/_axes.pyc in quiver(self, *args, **kw)
3802 if not self._hold:
3803 self.cla()
-> 3804 q = mquiver.Quiver(self, *args, **kw)
3805 self.add_collection(q, False)
3806 self.update_datalim(q.XY)
/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.8-intel.egg/matplotlib/quiver.pyc in __init__(self, ax, *args, **kw)
395 """
396 self.ax = ax
--> 397 X, Y, U, V, C = _parse_args(*args)
398 self.X = X
399 self.Y = Y
/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.8-intel.egg/matplotlib/quiver.pyc in _parse_args(*args)
357 nr, nc = 1, U.shape[0]
358 else:
--> 359 nr, nc = U.shape
360 if len(args) == 2: # remaining after removing U,V,C
361 X, Y = [np.array(a).ravel() for a in args]
有什么建议么? 这也不是quiver3d_demo.py-我在独立制作3d颤动图时遇到了麻烦。
您可能有旧版本的matplotlib。 matplotlib网站上说需要版本1.4.0或更高版本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.