matplotlib qt imshow animate [duplicate]

一曲冷凌霜 提交于 2019-12-01 20:21:09

问题


Does imshow animation work with the qt-backend? The following works fine in non-qt but does not animate using qt - just shows the last frame:

img = standard_normal((40,40))
image =imshow(img,interpolation='nearest',animated=True)
for k in range(1,10): 
     img = standard_normal((40,40)) 
     image.set_data(img) 
     draw()

回答1:


You either need to add a pause in the loop after the draw or use the matplotlib.animation module (doc) (tutorial).

possibly related matplotlib.pyplot/pylab not updating figure while isinteractive(), using ipython -pylab:




回答2:


I'll take a look at that but it looks like for using the qt backend the call to:

QApplication.ProcessEvents()

updates the imshow plot.



来源:https://stackoverflow.com/questions/13595566/matplotlib-qt-imshow-animate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!