Octave (212 143136 bytes)
(Now including some ideas due to @ChrisTaylor.)
[x[y,y]=meshgridx]=ndgrid(-2:.01:2);z=c=x+i*y;m=0*e(401);for;z=c=x+i*y;m=c-c;for n=0:99;m+=abs(z)<2;z=z.^2+c;end;imagesc(m);colormap([hsv(128)(1+mod(0:79:79007890,128),:);0,0,0])
With whitespace:
[x[y,y]x] = meshgridndgrid(-2:.01:2);
z = c = x + i*y;
m = 0*e(401);c-c;
for n=0:99
m += abs(z)<2;
z = z.^2 + c;
end
imagesc(m)
colormap([hsv(128)(1+mod(0:79:7900,128),:);
0,0,0])
Output:
This would likely work on Matlab too. (Last time I usedTo convert to Matlab, it did not support +=change "m+=abs(z)<2
" to "m=m+(abs(z)<2)
". [+3 bytes]
To make the aspect ratio 1:1, so fixing that might add one byte. But that was a long time ago";axis image
".) [+11 bytes]
My first answer (212 bytes):
[x,y]=meshgrid(-2:.01:2);z=c=x+i*y;m=0*e(401);for n=0:99;m+=abs(z)<2;z=z.^2+c;endfor;t=[0*e(1,7);2.^[6:-1:0]];[s{1:7}]=ndgrid(num2cell(t,1){:});t=1+sum(cat(8,s{:}),8);imagesc(m);colormap([hsv(128)(t(:),:);0,0,0])