Mandelbrot set: Difference between revisions
m
→Mercator zooms of the Mandelbrot set using NumPy: Parameter changes only
m (→Mercator zooms of the Mandelbrot set using NumPy: a few more simplifications) |
m (→Mercator zooms of the Mandelbrot set using NumPy: Parameter changes only) |
||
Line 7,160:
W = (U - 1) + (V - h / d) * 1j
C = (-0.4 + 0.6 * 1j) + 1.
A, B = C.real, C.imag
Line 7,171:
T[M] = k + 1
fig, ax = plt.subplots(figsize=(
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 =
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.
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(
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)
plt.savefig("Mandelbrot_zoom.png", dpi=100)</lang>
|