79619768

Date: 2025-05-13 13:41:33
Score: 0.5
Natty:
Report link

First i tried to run your code just as .py script with following modifications and its working:

# was missing
import time
#plt.pause(2)  # i commented this line, after pause plot not resuming any more
ani = FuncAnimation(fig, update, frames=consume, interval=20, save_count=N)
plt.show() # i added, without it animation not starting

But your question is about jupyter notebook, and here modifications to make it works:

import time
from IPython.display import HTML
#plt.pause(2)  # i commented this line, after pause plot not resuming any more
ani = FuncAnimation(fig, update, frames=consume, interval=20, save_count=N)
HTML(ani.to_jshtml()) # i added, without it animation not starting

Result: enter image description here

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: asat