Advertisement
Guest User

m_plot_3d.py

a guest
Jun 18th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. kimport numpy as np
  2. import matplotlib.pyplot as plt
  3. from matplotlib import cm
  4. from mpl_toolkits.mplot3d import Axes3D
  5.  
  6. X = np.arange(-5, 5, 0.25)
  7. Y = np.arange(-5, 5, 0.25)
  8. X, Y = np.meshgrid(X, Y)
  9. R = np.sqrt(X**2 + Y**2)
  10. Z = np.sin(R)
  11.  
  12. fig = plt.figure()
  13. ax = Axes3D(fig)
  14. ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.viridis)
  15.  
  16. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement