xmin=-1.5;
xmax=1.5;
ymin=-1.5;
ymax=1.5;

npts=1000;
x=xmin:(xmax-xmin)/npts:xmax;
y=ymin:(ymax-ymin)/npts:ymax;
[X,Y]=meshgrid(x,y);

Z = X + i*Y;
C=0.4+0.6*i;
C=0.2+0.65*i;
C=-0.7589-0.0753*i;
cnt=zeros(size(Z));
jmax=500;

init=cputime;
for j=1:jmax
    Z = Z.^2 + C;
    inside=abs(Z)<=2;
    cnt=cnt+inside;
end
%cnt=log(cnt);
fin=cputime-init
pcolor(X,Y,cnt),shading interp
%imagesc(cnt)
%colormap(flipud(jet(jmax)))
colormap(jet)
axis square
axis off
