Advertisement
Guest User

Untitled

a guest
Sep 15th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3.  
  4. x, y = np.ogrid[-2:4:1024j, -1.5:1.5:768j]
  5.  
  6. r = x + 1j * y
  7. z = 0.4
  8.  
  9. for g in range(100):
  10. print('Iteration number: ', g)
  11. z = z ** 2 + r
  12.  
  13. threshold = 256
  14. mask = np.abs(z) < threshold
  15.  
  16. plt.imshow(mask.T, extent=[-2, 4, -1.5, 1.5])
  17. plt.gray()
  18. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement