%matplotlib inline
# see https://youtu.be/ovJcsL7vyrk?t=322 for more context
# The following program carries out the iterative calculation stated above,
# sweeping across different values of r.
# n == number of iterations (x-axis)
from logistics_bifurcation import *
for r in reversed_logspace(2.9,3.84,num=200):
fig, ax = plt.subplots()
scat = ax.scatter(np.arange(NUM_ITER), get_series(r), marker="+")
ax.set_title(f"{r=}")
ax.set_xlabel("number of iterations")
if np.isclose(r, 3.83, atol=1E-2):
ax.set_title(rf"{r=},$\approx$ period 3!")
plt.show(block=False)
plt.close(fig)