Advertisement
khaiwen1111

Untitled

Nov 13th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. from mpl_toolkits import mplot3d
  2. import matplotlib.pyplot as plt
  3. import math
  4. import numpy as np
  5. def z_func(x,y):
  6.     return np.exp(np.cos(x**2+y**2))
  7. x=np.linspace(-2*math.pi,2*math.pi,30)
  8. y=np.linspace(-2*math.pi,2*math.pi,30)
  9. Z=z_func(X,Y)
  10. X,Y=np.meshgrid(x,y)
  11. ax=plt.axes(projection='3d')
  12. fig=plt.figure(figsize=(10,8))
  13. ax.plot_surface(X,Y,Z)
  14. ax.view_init(45,45)
  15. ax.set_title("September2016 Q3(b)")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement