Update SIR_model.py
Browse files- SIR_model.py +2 -0
SIR_model.py
CHANGED
|
@@ -221,6 +221,8 @@ def main(total_population, initial_infected, initial_recovered, beta, gamma, mod
|
|
| 221 |
return[ax]
|
| 222 |
|
| 223 |
anim = FuncAnimation(fig2, animate, frames=times, interval=50, blit=True)
|
|
|
|
|
|
|
| 224 |
plt.show()
|
| 225 |
|
| 226 |
return [fig1, anim]
|
|
|
|
| 221 |
return[ax]
|
| 222 |
|
| 223 |
anim = FuncAnimation(fig2, animate, frames=times, interval=50, blit=True)
|
| 224 |
+
# Save the animated plot
|
| 225 |
+
anim.save('animated_plot.gif', writer='imagemagick')
|
| 226 |
plt.show()
|
| 227 |
|
| 228 |
return [fig1, anim]
|