Note

Go to the endto download the full example code.

3D surface (solid color)#

Demonstrates a very basic plot of a 3D surface using a solid color.

importmatplotlib.pyplotaspltimportnumpyasnpfig=plt.figure()ax=fig.add_subplot(projection='3d')# Make datau=np.linspace(0,2*np.pi,100)v=np.linspace(0,np.pi,100)x=10*np.outer(np.cos(u),np.sin(v))y=10*np.outer(np.sin(u),np.sin(v))z=10*np.outer(np.ones(np.size(u)),np.cos(v))# Plot the surfaceax.plot_surface(x,y,z)# Set an equal aspect ratioax.set_aspect('equal')plt.show()
surface3d 2

Tags:plot-type: 3Dlevel: beginner

Gallery generated by Sphinx-Gallery