function_plotting_py.ipynb
import numpy,pylab
def gen(a,n):
i=1; z0=numpy.array([1+1j])[0]; xyi=[(a*z0).real,(a*z0).imag]
while i<=n:
yield xyi; i+=1; xi,yi=xyi[0],xyi[1]; zi=numpy.array([xi+yi*1j])[0]
zi=a+(1-a)*zi; xyi=[zi.real,zi.imag]
n=500000; a=.01+.15*1j; xy=gen(a,n); xyn=numpy.array([el for el in xy])
pylab.figure(figsize=(10,10)); ax=pylab.gca(); ax.set_facecolor('ghostwhite')
pylab.scatter(xyn[:,0],xyn[:,1],s=1,c=[numpy.random.random(3)])
pylab.grid(c='slategray',alpha=.4); pylab.show()
No comments:
Post a Comment