function julia01(any)
% Mandelbrot set v0.14
% Sai Wing Man 05/09/2006
% send comments to dmn001@gmail.com
% RUN: 'mandelbrot14(1)' first to get the axes, then 'mandelbrot14' (no argin) after..
% .. but first zooming in using the zoom tool.
tic
if nargin==1
    %default axes
    x0=-1.6;x1=1.6;y0=-1.5;y1=1.5;
    axis([x0 x1 y0 y1])
end
k=axis; x0=k(1); x1=k(2); y0=k(3); y1=k(4);
clc
clf
num=440;
[x,y]=meshgrid( x0:(x1-x0)/(num-1):x1 , (y0:(y1-y0)/(num-1):y1));
%c=-0.70176-0.3842i
%c=0.285+0.01*i;
%c=-0.8+0.156*i;
c=-0.4+0.6*i;
z=x+y*i;
z0=z;
jvec=5:5:90;
jindex=1;
cmap=colormap(hsv(length(jvec)));
hold on
for j=1:max(jvec)
    z=z.^2+c;
    if jvec(jindex)==j
        if jindex<length(jvec)
            plot(real(~isnan(z).*z0),imag(~isnan(z).*z0),'.','Markersize',0.5,'Color',cmap(jindex,:))
        end
        clc
        jindex=jindex+1;
        perc=j/max(jvec)*100/2+(jindex-2)/length(jvec)*100/2;
        disp([int2str(perc) '% done'])
    end
end
plot(real(~isnan(z).*z0),imag(~isnan(z).*z0),'.','Markersize',0.5,'Color',[0 0 0])
axis([x0 x1 y0 y1])
clc
toc

%{
Copyright (c) 2006, Sai Wing Man
All rights reserved.

Redistribution and use in source and binary forms, with or without 
modification, are permitted provided that the following conditions are 
met:

    * Redistributions of source code must retain the above copyright 
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright 
      notice, this list of conditions and the following disclaimer in 
      the documentation and/or other materials provided with the distribution
      
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
POSSIBILITY OF SUCH DAMAGE.
%}