Mandelbrot set: Difference between revisions

m
Line 7,160:
W = (U - 1) + (V - h / d) * 1j
 
C = (-0.4 + 0.6 * 1j) + 1.05 * W
A, B = C.real, C.imag
 
Line 7,171:
T[M] = k + 1
 
fig, ax = plt.subplots(figsize=(84, 63))
ax.imshow(T, cmap=plt.cm.twilight_shifted, vmin=0, vmax=n)
plt.savefig("Mandelbrot_set.png", dpi=100)
Line 7,185:
import matplotlib.pyplot as plt
 
d, h = 250200, 700500 # pixel density and zoom depth
n, r = 100, 2.5 # number of iterations and escape radius (r > 2)
 
Line 7,194:
W = np.exp(U * 1j - V)
 
C = (-0.41031 + 0.61021 * 1j) + 1.05 * W
A, B = C.real, C.imag
 
Line 7,212:
S = (150 * D) ** 2 # factor depends on the size of the figure
 
fig, ax = plt.subplots(32, 2, figsize=(1214, 1814))
ax[0, 0].scatter(A[0:200], B[0:200], s=S[0:200], c=T[0:200], cmap=plt.cm.twilight_shifted, vmin=0, vmax=n)
ax[0, 1].scatter(A[100:300], B[100:300], s=S[0:200], c=T[100:300], cmap=plt.cm.twilight_shifted, vmin=0, vmax=n)
ax[1, 0].scatter(A[200:400], B[200:400], s=S[0:200], c=T[200:400], cmap=plt.cm.twilight_shifted, vmin=0, vmax=n)
ax[1, 1].scatter(A[300:500], B[300:500], s=S[0:200], c=T[300:500], cmap=plt.cm.twilight_shifted, vmin=0, vmax=n)
ax[2, 0].scatter(A[400:600], B[400:600], s=S[0:200], c=T[400:600], cmap=plt.cm.twilight_shifted, vmin=0, vmax=n)
ax[2, 1].scatter(A[500:700], B[500:700], s=S[0:200], c=T[500:700], cmap=plt.cm.twilight_shifted, vmin=0, vmax=n)
plt.savefig("Mandelbrot_zoom.png", dpi=100)</lang>
 
305

edits