0% found this document useful (0 votes)
17 views1 page

Lines3d Demo

This Python code imports libraries for 3D plotting, creates a 3D plot of a parametric curve, and displays the plot.

Uploaded by

asdf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views1 page

Lines3d Demo

This Python code imports libraries for 3D plotting, creates a 3D plot of a parametric curve, and displays the plot.

Uploaded by

asdf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

import matplotlib as mpl

from mpl_toolkits.mplot3d import Axes3D


import numpy as np
import matplotlib.pyplot as plt

mpl.rcParams['legend.fontsize'] = 10

fig = plt.figure()
ax = fig.gca(projection='3d')
theta = np.linspace(-4 * np.pi, 4 * np.pi, 100)
z = np.linspace(-2, 2, 100)
r = z**2 + 1
x = r * np.sin(theta)
y = r * np.cos(theta)
ax.plot(x, y, z, label='parametric curve')
ax.legend()

plt.show()

You might also like