【问题标题】:matplotlib qt imshow animate [duplicate]matplotlib qt imshow animate [重复]
【发布时间】:2012-11-15 17:49:54
【问题描述】:

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

【问题讨论】:

    标签: python qt matplotlib animated


    【解决方案1】:

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

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

    【讨论】:

      【解决方案2】:

      我会看一下,但它看起来像使用 qt 后端调用:

      QApplication.ProcessEvents()
      

      更新 imshow 图。

      【讨论】:

        猜你喜欢
        • 2018-11-10
        • 2016-05-07
        • 1970-01-01
        • 1970-01-01
        • 2019-01-22
        • 2015-07-30
        • 1970-01-01
        • 1970-01-01
        • 2017-09-26
        相关资源
        最近更新 更多