Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

matplotlib FuncAnimation: when to stop?

According to matplotlib's documentation, FuncAnimation calls a funtion repeatedly to make an animation.

The question is, how should I tell FuncAnimation() to stop when no more image data available?

like image 889
Jedi Avatar asked Dec 29 '14 02:12

Jedi


1 Answers

If you know how many frames are in your image data then make sure among the other arguments in FuncAnimation() that you have:

frames=#frames
repeat=False

It then stops when it reaches the frame limit. Not perfect but this seems to be a common concern without a proper solution.

like image 108
cardamom Avatar answered Oct 23 '22 14:10

cardamom