*(  WQ,  FS 2013, nb zu Compile  *)

ApfelCalc[z0_Complex,nmax_Integer]:=Module[{n=0,z=0},
While[Abs[z]<2 && n<nmax, z=z^2+z0; n++];
n]

ApfelCalc[1+0.1 I ,50]

c=ColorData["TemperatureMap"]

ApfelPlot[z0_Complex,z1_Complex,nmax_Integer,dx_Real]:=
Module[{r0=Re[z0],r1=Re[z1],i0=Im[z0],i1=Im[z1]},ListDensityPlot[Table[ApfelCalc[r+j I ,nmax],{j,i0,i1,dx},{r,r0,r1,dx}],AspectRatio->(i1-i0)/(r1-r0),FrameTicks->None,ColorFunction->c]]

ApfelPlot[-2-1.25 I,1.25+1.25 I,50,0.02]

(* nun mit Compile *)

ApfelCalcC=Compile[{{z0,_Complex},{nmax,_Integer}},Module[{n=0,z=0. I},
While[Abs[z]<2 && n<nmax, z=z^2+z0; n++];n]];

ApfelPlotC[z0_Complex,z1_Complex,nmax_Integer,dx_Real]:=
Module[{r0=Re[z0],r1=Re[z1],i0=Im[z0],i1=Im[z1]},ListDensityPlot[Table[ApfelCalcC[r+j I ,nmax],{j,i0,i1,dx},{r,r0,r1,dx}],AspectRatio->(i1-i0)/(r1-r0),FrameTicks->None,ColorFunction->c]]

ApfelPlotC[-0.7476+0.0976 I,-0.7452+0.0993 I,200,0.3*10^(-5)]

(* Ein nicht sehr geglueckter Versuch ein Profil zu erstellen *)

ApfelPlotC3D[z0_Complex,z1_Complex,nmax_Integer]:=
Module[{r0=Re[z0],r1=Re[z1],i0=Im[z0],i1=Im[z1]},Plot3D[{j,r,ApfelCalcC[r+j  I ,nmax]},{j,i0,i1},{r,r0,r1},PlotPoints->200,PlotRange->{0,50},Mesh->False,Boxed->False]]

ApfelPlotC3D[-1.5-1.25 I,1.25+1.25 I,200]

z0=-0.7476+0.0976 I;z1=-0.7452+0.0993 I;
r0=Re[z0];r1=Re[z1];i0=Im[z0];i1=Im[z1];
dx=0.3*10^(-4);

frac=Flatten[Table[{j,r,ApfelCalcC[r+j I ,150]},{j,i0,i1,dx},{r,r0,r1,dx}],1];

ListPlot3D[frac,Mesh->False,Boxed->False]

(* Und nun von einem Profi (zitiert nach H.-G.Gräbe) *)

ReliefApfelPlot[z0_Complex,z1_Complex, nmax_Integer,dx_Real]:=
Module[{r0=Re[z0], r1=Re[z1],i0=Im[z0], i1=Im[z1]},ReliefPlot[Table[ApfelCalcC[r+I i,nmax],{i,i0,i1,dx},{r,r0,r1,dx}],AspectRatio->((i1-i0)/(r1-r0)),FrameTicks->None,ColorFunction->c] ]

g=ReliefApfelPlot[-0.7476+0.0976I,-0.7452+0.0993I,200,.3 (10^(-5))]