FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Matplotlib QtAgg backend animation freezes · Issue #177 · matplotlib/matplotlib · GitHub

Repository navigation

Matplotlib QtAgg backend animation freezes #177

Closed

Description

Original report at SourceForge, opened Sun Nov 21 10:17:12 2010

Animation doesn't work in matplotlib with QtAgg backend. You should call QApplication.processEvents(), in draw() for that backend.

from PyQt4.QtGui import QApplication
import matplotlib

from pylab import *
from time import *
x = arange(5)
y = arange(5)
ion()
hold(False)
plot(x,y)
z = array(transpose(matrix(y))*matrix(x))
p = imshow(z)
for i in xrange(5):
z = z + 2
p.set_data(z)
clim()
draw()
QApplication.processEvents() #otherwise animation freezes. draw() should call that.
print "step"
sleep(1)

Activity

  1. efiring commented on Jun 21, 2011

    Member

    This is not really a bug, and I don't think the suggested change is needed.
    You can use gcf().canvas.flush_events() to force the event loop to run.
    draw() is calling update(), which is what it should do. The real problem is
    that this is not a good way to try to do animation. To make simple
    pyplot-level animation easier, I have made a new pause() function which I
    think provides a reasonably clean solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL