Skip to content

Instantly share code, notes, and snippets.

@pankgeorg
Last active May 14, 2020 20:12
Show Gist options
  • Save pankgeorg/e9b06dbb0a4287da9a5b00e87cd270a9 to your computer and use it in GitHub Desktop.
Save pankgeorg/e9b06dbb0a4287da9a5b00e87cd270a9 to your computer and use it in GitHub Desktop.
zn+1 = zn*r*(1-zn)
%matplotlib inline
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib
L = 5000
N = 70
Ζ0 = 0.0000001
fig=plt.figure(figsize=(18, 16), dpi= 80, facecolor='w', edgecolor='k')
Rs = np.linspace(1, 4., L)
Zn = np.ones(L) * Ζ0
rainbow = cm.rainbow(np.linspace(0, 1, N))
for c in rainbow:
Zn = Rs * Zn * (1 - Zn)
ax = plt.scatter(Rs, Zn , s=0.05, color=c)
cb = plt.colorbar(cmap=rainbow, norm=matplotlib.colors.Normalize(vmin=0, vmax=1/N), orientation='horizontal')
cb.set_label("Iteration # ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment