4

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()
Ross W
  • 1,165
  • 3
  • 12
  • 23

2 Answers2

0

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:

Community
  • 1
  • 1
tacaswell
  • 79,602
  • 19
  • 200
  • 189
0

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.

Ross W
  • 1,165
  • 3
  • 12
  • 23