Mandelbrot set: Difference between revisions

m
→‎{{header|Python}}: Code shortened by two lines
m (→‎{{header|Python}}: Minor cosmetic change)
m (→‎{{header|Python}}: Code shortened by two lines)
Line 6,394:
import matplotlib.pyplot as plt
 
d, n = 100, 50 # pixel density & number of iterations
r = 2.5 # escape radius (must be greater than 2)
n = 50 # number of iterations
r = 2.5 # escape radius (must be greater than 2)
 
x = np.linspace(-2.5, 1.5, 4*d+1)
Line 6,412 ⟶ 6,411:
T[M] = k + 1
 
plt.figure(dpi=200)
plt.imshow(T, cmap=plt.cm.twilight_shifted)
plt.savefig('mandelbrot.png', dpi=200)</lang>
 
=={{header|R}}==
305

edits