python - matplotlib qt imshow 动画

标签 python qt matplotlib animated

<分区>

imshow 动画是否与 qt-backend 一起工作?以下在非 qt 中工作正常但不使用 qt 设置动画 - 仅显示最后一帧:

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()

最佳答案

您要么需要在绘制后的循环中添加一个pause,要么使用matplotlib.animation 模块(doc) (tutorial) .

可能相关matplotlib.pyplot/pylab not updating figure while isinteractive(), using ipython -pylab :

关于python - matplotlib qt imshow 动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13595566/

相关文章:

python - 尝试循环遍历字符串,找到某个数字,但找不到重复的数字(python)

python - 哪些 python SOAP 库仍在维护?

python - lxml xpath无法显示html项目

python - 使用 pyqt5 和 matplotlib 进行图形滚动

python - 如何使用 fill_ Between 更改轴

python - 调用另一个装饰器函数的装饰函数会正常返回吗?

c++ - 使用 QLockFile::setStaleLockTime() 但锁不会过时?

c++ - Qt中连接不同类的信号槽

c++ - 从 qmake 运行脚本以获取内部版本号

python - 如何使用 matplotlib 自动设置轴来绘制二维向量?