你只是通过
allys
。您还需要为plt.scatter
中,因为它需要
x
和
y
坐标才能工作。e.g.
allys = []
allxs = []
for r in np.arange(0.001, 4, 0.001):
y = np.random.rand()
for t in range(1000):
y = r * y * (1 - y)
if t > 959:
allys.append(y)
allxs .append(r)
plt.scatter(allxs , allys, color='black', s=1)