SHARE
TWEET

Untitled

a guest Jul 17th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from mpl_toolkits.mplot3d import Axes3D
  2. from matplotlib import cm
  3. from matplotlib.colors import LogNorm
  4. import matplotlib.pyplot as plt
  5. import numpy as np
  6.  
  7. fig = plt.figure()
  8. ax = Axes3D(fig, azim = -128, elev = 52)
  9. X = np.arange(-4.5, 4.5, 0.1)
  10. Y = np.arange(-4.5,4.5, 0.1)
  11. X, Y = np.meshgrid(X, Y)
  12. Z = (1.5-X+X*Y)**2+(2.25-X+X*Y**2)**2+(2.625-X+X*Y**3)**2  
  13. ax.plot_surface(X, Y, Z, rstride = 1, cstride = 1, norm = LogNorm(), cmap = cm.jet)
  14. plt.xlabel("x")
  15. plt.ylabel("y")
  16. plt.title("Beale function")
  17.  
  18. plt.savefig("Beale function.PNG")
  19.  
  20. plt.show()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top