matplotlib qt imshow animate [重复]

2023-12-11

imshow 动画可以与 qt 后端一起使用吗?以下在非 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 module (doc) (教程).

可能相关matplotlib.pyplot/pylab 在 isinteractive() 时不更新图形,使用 ipython -pylab:

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

matplotlib qt imshow animate [重复] 的相关文章

随机推荐