Skip to content

Instantly share code, notes, and snippets.

@predic8
Created March 29, 2020 15:50
Show Gist options
  • Save predic8/d1d448476e9f0d06412f83a0bb7bb275 to your computer and use it in GitHub Desktop.
Save predic8/d1d448476e9f0d06412f83a0bb7bb275 to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
p = 1000
i = 1
r = 3
imun = 0
def empfaenglich():
return p - i - i
li = []
limun = []
while imun < 1000:
neu = i * r
print("Infiziert: ", i, "Neu:",neu,"Imun:",imun)
li.append(i)
limun.append(imun)
imun += i
i = neu
plt.interactive(True)
fig, ax = plt.subplots()
ax.plot(range(1,len(li) + 1), li)
ax.plot(range(1,len(li) + 1), limun)
plt.savefig("graph.svg")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment