File:Mandelbrot set, plotted with Matplotlib.svg

原始檔案(SVG 檔案,表面大小:900 × 900 像素,檔案大小:1.46 MB)


摘要

描述
English: The Mandelbrot set, plotted with Python and Matplotlib. (Originally programmed for Rosetta Code.)
日期
來源 自己的作品
作者 Morn
SVG開發
InfoField
 
SVG檔案的原始碼通過W3C驗證
 
向量圖形使用Matplotlib創作。
原始碼
InfoField

Python code

Source code
from pylab import *
from numpy import NaN

xmin, xmax, ymin, ymax = -2, 0.8, -1.5, 1.5
max_it = 100    # maximum number of iterations
px     = 3000	# vertical lines
res    = (ymax - ymin) / px   # grid resolution

figure(figsize = (10, 10))

def m(c):
	z = 0
	for n in range(1, max_it + 1):
		z = z**2 + c
		if abs(z) > 2:
			return n
	return NaN

X = arange(xmin, xmax + res, res)
Y = arange(ymin, ymax + res, res)
Z = zeros((len(Y), len(X)))

for iy, y in enumerate(Y):
	print (iy + 1, "of", len(Y))
	for ix, x in enumerate(X):
		Z[-iy - 1, ix] = m(x + 1j * y)

save("mandel", Z)	# save array to file

imshow(Z, cmap = plt.cm.prism, interpolation = 'none',
  extent = (X.min(), X.max(), Y.min(), Y.max()))
xlabel("Re(c)")
ylabel("Im(c)")
savefig("mandelbrot_python.svg")
show()

授權條款

我,本作品的著作權持有者,決定用以下授權條款發佈本作品:
Creative Commons CC-Zero 此檔案在創用CC CC0 1.0 通用公有領域貢獻宣告之下分發。
在此宣告之下分發本作品者,已依據各國著作權法,在全世界放棄其對本作品所擁有的著作權及所有相關相似的法律權利,從而將本作品貢獻至公有領域。您可以複製、修改、分發和演示該作品,用於任何商業用途,所有這些都不需要請求授權。

註解
InfoField
該圖片含有註解:在維基媒體共享資源上查看註解

說明

添加單行說明來描述出檔案所代表的內容

在此檔案描寫的項目

描繪內容

檔案來源 Chinese (Taiwan) (已轉換拼寫)

檔案歷史

點選日期/時間以檢視該時間的檔案版本。

日期/時間縮⁠圖尺寸使用者備⁠註
目前2015年7月20日 (一) 06:49於 2015年7月20日 (一) 06:49 版本的縮圖900 × 900(1.46 MB)Mornlarger nominal image size; smaller labels
2015年7月18日 (六) 16:42於 2015年7月18日 (六) 16:42 版本的縮圖720 × 540(1.46 MB)Morn{{Information |Description ={{en|1=The Mandelbrot set, plotted with Python and Matplotlib. (Originally programmed for Rosetta Code.)}} |Source ={{own}} |Author =Morn |Date =2015-07-18 |Permission = |other_...

下列頁面有用到此檔案:

全域檔案使用狀況

以下其他 wiki 使用了這個檔案:

詮釋資料