Matplotlib animation not working in IPython Notebook (blank plot)

前端 未结 5 1333
悲&欢浪女
悲&欢浪女 2021-02-01 20:36

I\'ve tried multiple animation sample codes and cannot get any of them working. Here\'s a basic one I\'ve tried from the Matplotlib documentation:

\"\"\"
A simp         


        
5条回答
  •  有刺的猬
    2021-02-01 21:07

    I ran into this issue as well and found I needed to understand the concept of matplotlib backends, how to enable a specific backend, and which backends work with FuncAnimation. I put together an ipython notebook that explains the details and summarizes which backends work with FuncAnimation on Mac, Windows, and wakari.io. The notebook also summarizes which backends work with the ipython interact() widget, and where plots appear (inline or secondary window) for basic matplotlib plotting. Code and instructions are included so you can reproduce any of the results.

    The bottom line is that you can't get an animation created with FuncAnimation to display inline in an ipython notebook. However, you can get it to display in a separate window. It turns out that I needed this to create visualizations for an undergraduate class I am teaching this semester, and while I would much prefer the animations to be inline, at least I was able to create some useful visualizations to show during class.

提交回复
热议问题