Advertisement
luluty

Untitled

Nov 9th, 2019
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. import numpy as np
  2. import matplotlib.cm as cm
  3. import matplotlib.pyplot as plt
  4. import matplotlib.cbook as cbook
  5. from matplotlib.path import Path
  6. from matplotlib.patches import PathPatch
  7.  
  8. delta = 0.02
  9. x = y = np.arange(-3.0, 3.0, delta)
  10. X, Y = np.meshgrid(x, y)
  11. # Z1 = np.cos(X)
  12. # Z2 = np.sin(Y)
  13. # Z = (Z1 - Z2) * 2
  14.  
  15. Z = np.cos(X)*np.sin(Y)
  16.  
  17. fig, ax = plt.subplots()
  18.  
  19.  
  20. im = ax.imshow(Z, interpolation='nearest',
  21. origin='lower', extent=[-3, 3, -3, 3],
  22. vmax=abs(Z).max(), vmin=-abs(Z).max())
  23.  
  24. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement