Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import matplotlib.pyplot as plt
- x, y = np.ogrid[-2:4:1024j, -1.5:1.5:768j]
- r = x + 1j * y
- z = 0.4
- for g in range(100):
- print('Iteration number: ', g)
- z = z ** 2 + r
- threshold = 256
- mask = np.abs(z) < threshold
- plt.imshow(mask.T, extent=[-2, 4, -1.5, 1.5])
- plt.gray()
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement