File:Douady rabbit, plotted with Matplotlb.svg

Summary

Description
English: The Douady rabbit with seed value (-.123, .745) and 1,000 iterations
Date
Source Own work
Author Morn
SVG development
InfoField
Source code
InfoField

Python code

Source code
from pylab import *
from numpy import NaN
from matplotlib.colors import LogNorm

s = -.123, .745

res = .001    # grid resolution
max_it = 1000 # maximum number of iterations

figure(figsize = (10, 10))

def jul(a):
	z = a
	for n in range(1, max_it + 1):
		z = z**2 + s[0] + 1j * s[1]
		if abs(z) > 2:
			return n
	return NaN

X = arange(-2, 2 + res, res)
Y = arange(-1.5,  1.5 + res, res)
Z = zeros((len(Y), len(X)))

for iy, y in enumerate(Y):
	print (iy + 1, "of", len(Y))
	for ix, x in enumerate(X):
		Z[-iy - 1, ix] = jul(x + 1j * y)

save("douady", Z)	# save array to file

imshow(Z, cmap = plt.cm.viridis, interpolation = 'none', norm = LogNorm(),
  extent = (X.min(), X.max(), Y.min(), Y.max()))
xlabel("Re(z)")
ylabel("Im(z)")
axis((-1.5, 1.5, -1.5, 1.5))
savefig("douady_rabbit_python.svg")
show()

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Category:CC-BY-SA-4.0#Douady%20rabbit,%20plotted%20with%20Matplotlb.svg
Category:Self-published work Category:Douady rabbit Category:Fractals with point symmetry
Category:CC-BY-SA-4.0 Category:Douady rabbit Category:Fractals with point symmetry Category:Self-published work Category:Valid SVG created with Matplotlib code