GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Matplotlib QtAgg backend animation freezes · Issue #177 · matplotlib/matplotlib

Matplotlib QtAgg backend animation freezes #177

New issue
Copy link
New issue
Copy link
Closed
Closed
Matplotlib QtAgg backend animation freezes#177
Copy link

Description

@ddale
ddale
opened on Jun 20, 2011
Issue body actions

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

    @efiring
    efiring
    on Jun 21, 2011
    Member
    More actions

    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.

  2. efiring
    closed this as completedon Jun 21, 2011
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

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.