def draw_mandelbrot(cx, cy, d):
"""
???(cx, cy)????d????Mandelbrot
"""
x0, x1, y0, y1 = cx-d, cx+d, cy-d, cy+d
y, x = np.ogrid[y0:y1:200j, x0:x1:200j]
c = x + y*1j
start = time.clock()
mandelbrot = np.frompyfunc(iter_point,1,1)(c).astype(np.float)
print("time=",time.clock() - start)
pl.imshow(mandelbrot, cmap=cm.jet, extent=[x0,x1,y0,y1])
#pl.gca().set_axis_off()
评论列表
文章目录