Created
January 24, 2019 08:28
-
-
Save lidopypy/701aa502d2e1a01ef42244bcc36fcca6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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