Matplotlib animation either freezes after a few frames or just doesn't work

前端 未结 8 1339
悲哀的现实
悲哀的现实 2020-12-18 06:04

I\'ve been trying for hours to get this simple script working, but nothing I do seems to help. It\'s a slight modification of the most basic animated plot sample code from t

8条回答
  •  遥遥无期
    2020-12-18 06:40

    calling time.sleep() or plt.pause() causes flicker on the graph window when using blitting, but I got good results by simply calling the event loop explicitely :

    fig.canvas.blit() # or draw()
    fig.canvas.start_event_loop(0.001) #1 ms seems enough
    

提交回复
热议问题