Section Navigation
fill_between
plt.subplots
histtype
floating_axes
Note
Go to the endto download the full example code.
This example demonstrates plotting a parametric curve in 3D.
importmatplotlib.pyplotaspltimportnumpyasnpax=plt.figure().add_subplot(projection='3d')# Prepare arrays x, y, ztheta=np.linspace(-4*np.pi,4*np.pi,100)z=np.linspace(-2,2,100)r=z**2+1x=r*np.sin(theta)y=r*np.cos(theta)ax.plot(x,y,z,label='parametric curve')ax.legend()plt.show()
Tags:plot-type: 3Dlevel: beginner
DownloadJupyternotebook:lines3d.ipynb
DownloadPythonsourcecode:lines3d.py
Downloadzipped:lines3d.zip
Gallery generated by Sphinx-Gallery