Guest User

Untitled

a guest
Feb 18th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. import numpy as np
  2. import numpy.random
  3. import matplotlib.pyplot as plt
  4.  
  5. def f(x, y):
  6. return x*y
  7.  
  8. xmax = ymax = 100
  9. z = numpy.array([[f(x, y) for x in range(xmax)] for y in range(ymax)])
  10.  
  11. plt.pcolormesh(z)
  12. plt.colorbar()
  13. curves = 10
  14. m = max([max(row) for row in z])
  15. levels = numpy.arange(0, m, (1 / float(curves)) * m)
  16. plt.contour(z, colors="white", levels=levels)
  17. plt.show()
Add Comment
Please, Sign In to add comment