Skip to content

Instantly share code, notes, and snippets.

@abecus
Last active July 8, 2020 12:25
Show Gist options
  • Save abecus/f298823b7f0cb498f086a6baf187b9ec to your computer and use it in GitHub Desktop.
Save abecus/f298823b7f0cb498f086a6baf187b9ec to your computer and use it in GitHub Desktop.
creates Mandelbrot Set
def plotter(n, thresh, max_steps=25):
mx = 2.48 / (n-1)
my = 2.26 / (n-1)
mapper = lambda x,y: (mx*x - 2, my*y - 1.13)
img=np.full((n,n), 255)
for x in range(n):
for y in range(n):
it = get_iter(complex(*mapper(x,y)), thresh=thresh, max_steps=max_steps)
img[y][x] = 255 - it
return img
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment