Jump to content

Mandelbrot set: Difference between revisions

→‎Mercator zooms of the Mandelbrot set using NumPy: Shifting escape times towards zero before compression
(→‎Mercator zooms of the Mandelbrot set using NumPy: Formula simplified by using the logarithm for base 2 and improved the resolution of the zoomed images.)
(→‎Mercator zooms of the Mandelbrot set using NumPy: Shifting escape times towards zero before compression)
Line 7,174:
T[N] = T[N] - np.log2(np.log2(abs(Z[N])) / np.log2(r))
 
T = T **- 0T.5min() # shifting escape times are compressed withtowards azero concavebefore functioncompression
mT = T ** 0.min()5 # minimum valuecompression of the transformed escape times with a concave function
 
fig, ax = plt.subplots(figsize=(4, 3))
ax.imshow(T, cmap=plt.cm.twilight_shifted, vmin=m)
plt.savefig("Mandelbrot_set.png", dpi=100)
 
Line 7,185:
 
fig, ax = plt.subplots(figsize=(6, 4))
ax.scatter(A, B, s=S, c=T, cmap=plt.cm.twilight_shifted, vmin=m0)
plt.savefig("Mandelbrot_plot.png", dpi=100)</lang>
A small change in the code above allows Mercator zooms of the Mandelbrot set (cf. David Madore: [http://www.madore.org/~david/math/mandelbrot.html ''Mandelbrot set images and videos'']). Escape time compression is used as described by David Madore.
Line 7,214:
T[N] = T[N] - np.log2(np.log2(abs(Z[N])) / np.log2(r))
 
T = T **- 0T.5min() # shifting escape times are compressed withtowards azero concavebefore functioncompression
mT = T ** 0.min()5 # minimum valuecompression of the transformed escape times with a concave function
 
fig, ax = plt.subplots(figsize=(4, 12))
ax.imshow(T, cmap=plt.cm.twilight_shifted, vmin=m)
plt.savefig("Mercator_map.png", dpi=100)
 
Line 7,225:
 
fig, ax = plt.subplots(2, 2, figsize=(12, 12))
ax[0, 0].scatter(A[0:300], B[0:300], s=S[0:300], c=T[0:300], cmap=plt.cm.twilight_shifted, vmin=m0)
ax[0, 1].scatter(A[100:400], B[100:400], s=S[0:300], c=T[100:400], cmap=plt.cm.twilight_shifted, vmin=m0)
ax[1, 0].scatter(A[200:500], B[200:500], s=S[0:300], c=T[200:500], cmap=plt.cm.twilight_shifted, vmin=m0)
ax[1, 1].scatter(A[300:600], B[300:600], s=S[0:300], c=T[300:600], cmap=plt.cm.twilight_shifted, vmin=m0)
plt.savefig("Mercator_zoom.png", dpi=100)</lang>
 
305

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.