Skip to content

Instantly share code, notes, and snippets.

@lidopypy
Created January 24, 2019 08:28
Show Gist options
  • Save lidopypy/701aa502d2e1a01ef42244bcc36fcca6 to your computer and use it in GitHub Desktop.
Save lidopypy/701aa502d2e1a01ef42244bcc36fcca6 to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
# Make data
for r in range(1,10,1):
u = np.linspace(0, 2 * np.pi, 1000)
v = np.linspace(0, np.pi, 1000)
x = r * np.outer(np.cos(u), np.sin(v))
y = r * np.outer(np.sin(u), np.sin(v))
z = r * np.outer(np.ones(np.size(u)), np.cos(v))
ax.plot_surface(x, y, z, color='b',alpha=1-r*0.1)
# Plot the surface
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment