Created
November 4, 2018 14:17
-
-
Save camilajenny/e29491d7fb8484855ab09bf7d3fc1cc9 to your computer and use it in GitHub Desktop.
3D curve
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment