Skip to content

Instantly share code, notes, and snippets.

@sgwizdak
Created November 8, 2011 04:24
Show Gist options
  • Save sgwizdak/1346990 to your computer and use it in GitHub Desktop.
Save sgwizdak/1346990 to your computer and use it in GitHub Desktop.
Mathematica Mandelbrot
Mandelbrot[c_] := Module[{z = 0, i = 0}, While[i < 100 && Abs[z] < 2, z = z^2 + c; i++]; i];
DensityPlot[Mandelbrot[xc + I yc], {xc, -2, 1}, {yc, -1.5, 1.5},
PlotPoints -> 275, Mesh -> False, Frame -> False,
ColorFunction -> (If[# != 1, Hue[#], Hue[0, 0, 0]] &)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment