import numpy as np
import matplotlib.pyplot as plt
nmax = 200
upplosning = 200
x = np.linspace(-2,2,upplosning)
y = np.linspace(-2,2,upplosning)
for b in y:
for a in x:
c = complex(a,b)
z = 0
n = 0
while (abs(z)<2 and n < nmax):
z = z**2 + c
n = n + 1
if n == nmax:
plt.plot(a, b, '.b', markersize=2)
plt.savefig('graph')
plt.show()