I want to use Jupyter notebook to host my code for a presentation, but I don't want to embed animation into the notebook. (Because it is time-consuming to embed the video.) I want to run the cells and pop up a screen as if I am running the code in the terminal.
from matplotlib.animation import FuncAnimation
from matplotlib.pyplot import plot, show, subplots, title # annotate
from IPython.display import HTML
anim = FuncAnimation(fig, update, frames=numlin, interval=100, fargs=(
d, g, lr_D, lr_G, hasFake, speed, show_sample),
init_func=init, blit=True, repeat=0)
HTML(anim.to_html5_video())
Why using the notebook? The main reason to use the notebook is that I have many different setups for an experiment. I want to use different cells to represent different configurations, and if people want to see results from a particular configuration, I can run it right away.
Time difference. The HTML function takes over a minute to generate the video I need. While in the terminal, the animation would just start. I want to prototype quickly during a meeting while the audience asks to show the results from different initial conditions.
There is also an unexpected behavior from the notebook. The video from the notebook is different from that popped up in the terminal. The video in the notebook did not erase existing frames while drawing, making the animation looks messy and cannot track the trajectory as good as its counterpart.
Animation from the notebook's output
Animation from the terminal's output
This drawing behavior is another reason why I don't want to use the notebook to display the animation.
Will the notebook needs to show other plots. I hope so, but it is not necessary. I can open another notebook for just plots if needed.
Please let me know if I do not explain it well.