In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
In [2]:
def diagram(n=1000,niters=1000):
ax = np.random.rand(n,n)
for j in range(n):
a = 4*j/n
for i in range(niters):
ax[:,j] = a*ax[:,j]*(1-ax[:,j])
return ax
In [3]:
%time ax = diagram()
In [4]:
n=1000
plt.plot( np.repeat(4/n*np.arange(n),n), ax.T.flatten(),'.',markersize=.1 )
Out[4]:
In [ ]: