Matplotlib animation + IPython: temporary disabling interactive mode?
As @tcaswell pointed out, the problem was caused by the callback that was indirectly calling plt.show().
I have a python a script that generates an animation using matplotlib's animation.FuncAnimation and animation.FFMpegWriter. It works well, but there's an issue when running the code in IPython: each frame of the animation is displayed on screen while being generated, which slows down the movie generation process.
I've tried issuing plt.ioff() before running the animation code, but the figure is still displayed on screen. Is there a way to disable this behavior in IPython?
On a related note, if a run the script from a shell (i.e. python myMovieGenScript.py), only one frame is shown, blocking execution. I can close it and the rest of the frames are rendered off screen (which is what I want). Is there a way to prevent that single frame to be displayed, so no user interaction is required?