from scipy import gplt
from scipy import *
import math

dim = 10
startCplx = -dim
startReal = -dim
end = dim
inc = 0.03

def f (z) :
	return 1 + z + (1.0/2.0) * z**2 + (1.0/6.0) * z**3 + (1.0/24.0) * z**4 #+ (1.0/120.0) * z**5

def p(r,i) :
	kappa = (r + i*1j)
	stable = f(kappa)
	if(abs(stable) < 1) :
		return 0
	return 1

Re = startCplx
Im = startReal

real = []
imaginary = []

while( Im <= end ):
	while( Re <= end):
		if( p(Re,Im) == 0 ):
			real.append(Re)
			imaginary.append(Im)
		Re += inc
	Im += inc
	Re = startReal

gplt.plot(real,imaginary,'notitle with points')
#gplt.output("img.png",'png color')
