Skip to content

Instantly share code, notes, and snippets.

@PkBadger
Created September 21, 2019 18:27
Show Gist options
  • Save PkBadger/c91030cfa196a809b17b67c8fec54593 to your computer and use it in GitHub Desktop.
Save PkBadger/c91030cfa196a809b17b67c8fec54593 to your computer and use it in GitHub Desktop.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['legend.fontsize'] = 10
fig = plt.figure()
ax = fig.gca(projection='3d')
# Prepare arrays x, y, z
theta = np.linspace(-1 * np.pi, np.pi, 100)
x = np.cos(theta) * np.sin(2*theta)
y = np.sin(theta) * np.sin(2 * theta)
z = np.cos(2 * 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