from visual import * from visual.graph import * nmax=50 x=0.3 r=0.20000 info="Logistic Map r=%8.6f x0=%8.6f" % (r,x) gd=gdisplay(xmin=0,xmax=nmax,ymin=0,ymax=1.0, title=info, xtitle="n", ytitle="x",height=600,width=800,x=0,y=200, foreground=color.black, background=color.white) print info xplot=gcurve(color=color.blue) xplot.plot(pos=(0,x)) for n in arange(1,nmax): rate(20) x =4.0*r* x*(1-x) xplot.plot(pos=(n,x)) print "%8.6f" % x