ax.plot_surface(x, y, z, rstride=1, cstride=1)
ax.set_xlabel(u'X')
ax.set_ylabel(u'Y')
ax.set_zlabel(u'Z')
plt.show()
plt.close(fig)
If you try
plt.plot(x,y), it works.
Traceback (most recent call last):
File "C:\Program Files\eclipse\plugins\org.python.pydev.debug_1.6.3.2010100513\pysrc\pydevd.py", line 1145, in
debugger.run(setup['file'], None, None)
File "C:\Program Files\eclipse\plugins\org.python.pydev.debug_1.6.3.2010100513\pysrc\pydevd.py", line 916, in run
execfile(file, globals, locals) #execute the script
File "C:\Users\user\Workspace\general\bug_list.py", line 13, in
ax.plot_surface(x, y, z, rstride=1, cstride=1)
File "C:\Python26\lib\site-packages\mpl_toolkits\mplot3d\axes3d.py", line 663, in plot_surface
rows, cols = Z.shape
AttributeError: 'list' object has no attribute 'shape'
Axes3D.plot_wireframe also doesn't work, but Axes3D.plot works.
Note, plot_surface and plot_wireframe should be doing a np.asanyarray() to the inputs, but the given code should still fail anyway because they are one dimensional and does not parametrically describe a surface.
Activity
WeatherGod commented on Jun 21, 2011
Note, plot_surface and plot_wireframe should be doing a np.asanyarray() to the inputs, but the given code should still fail anyway because they are one dimensional and does not parametrically describe a surface.
plot_surface now supports any array-like input. Closes matplotlib#181