Devashri commited on
Commit
0cd0668
·
verified ·
1 Parent(s): 5366cd4

Update SIR_model.py

Browse files
Files changed (1) hide show
  1. 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]