Mandelbrot set: Difference between revisions
m
→Advanced: Distance estimation and Mercator zoom: Changed parameters and increased accuracy for more beautiful images
m (→Advanced: Distance estimation and Mercator zoom: Small adjustments) |
m (→Advanced: Distance estimation and Mercator zoom: Changed parameters and increased accuracy for more beautiful images) |
||
Line 7,217:
import matplotlib.pyplot as plt
d, h =
n, r = 50,
x = np.linspace(0, 2, d, endpoint=False)
Line 7,244:
D = 2 / d # distance between points in the grid
S = (
fig, ax = plt.subplots(figsize=(
ax.scatter(A, B, s=S, c=T**0.5, cmap=plt.cm.nipy_spectral)
plt.savefig("Mandelbrot_plot.png", dpi=100)</lang>
Line 7,253:
import matplotlib.pyplot as plt
d, h = 400,
n, r = 250,
x = np.linspace(0, 2 * np.pi, d, endpoint=False)
Line 7,262:
G = np.exp(X * 1j - Y) # circular grid around zero
C = (-0.
A, B = C.real, C.imag
Line 7,275:
T[N] = 2 * abs(Z[N]) * np.log(abs(Z[N])) / abs(dZ[N])
fig, ax = plt.subplots(figsize=(4,
ax.imshow(T ** 0.1, cmap=plt.cm.nipy_spectral)
plt.savefig("Mercator_map.png", dpi=100)
D = 2 * np.pi / d * abs(G) # distance between points in the grid
S = (
fig, ax = plt.subplots(2, 2, figsize=(
ax[0, 0].scatter(A[0:300], B[0:300], s=S[0:300], c=T[0:300]**0.5, cmap=plt.cm.nipy_spectral)
ax[0, 1].scatter(A[100:400], B[100:400], s=S[0:300], c=T[100:400]**0.4, cmap=plt.cm.nipy_spectral)
|