Update SIR_model.py
Browse files- SIR_model.py +2 -0
SIR_model.py
CHANGED
|
@@ -204,6 +204,7 @@ def main(total_population, initial_infected, initial_recovered, beta, gamma, mod
|
|
| 204 |
ax.set_title('Population over time')
|
| 205 |
ax.legend()
|
| 206 |
ax.grid(True)
|
|
|
|
| 207 |
|
| 208 |
def animate(frame):
|
| 209 |
ax.clear()
|
|
@@ -217,6 +218,7 @@ def main(total_population, initial_infected, initial_recovered, beta, gamma, mod
|
|
| 217 |
ax.set_title('Population over time')
|
| 218 |
ax.legend()
|
| 219 |
ax.grid(True)
|
|
|
|
| 220 |
|
| 221 |
anim = FuncAnimation(fig2, animate, frames=times, interval=50, blit=True)
|
| 222 |
plt.show()
|
|
|
|
| 204 |
ax.set_title('Population over time')
|
| 205 |
ax.legend()
|
| 206 |
ax.grid(True)
|
| 207 |
+
|
| 208 |
|
| 209 |
def animate(frame):
|
| 210 |
ax.clear()
|
|
|
|
| 218 |
ax.set_title('Population over time')
|
| 219 |
ax.legend()
|
| 220 |
ax.grid(True)
|
| 221 |
+
return[ax]
|
| 222 |
|
| 223 |
anim = FuncAnimation(fig2, animate, frames=times, interval=50, blit=True)
|
| 224 |
plt.show()
|