Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Unresponsive figure when using interactive mode on Windows #3052

Closed
@natezb

Description

@natezb

I am using Windows running Python 2.7.5 (and IPython 1.1.0) with Matplotlib 1.3.1, using the Qt4Agg backend. When I run

import matplotlib.pyplot as plt
plt.ion()
plt.plot([1, 2, 3])

a (blank) figure window is immediately opened and is unresponsive ("loading" cursor on mouseover, can't move window, etc.). This happens in both Python and IPython, and whether I import MPL directly or via pylab.

If I call plt.pause(2), the plot itself is drawn and the figure window can be moved, but it may be moved only until the pause command expires. It seems that dragging the window causes the pause to last longer, i.e. the GUI main loop seems to be blocking the 'countdown' from happening.

If I omit the plt.ion() and call plt.show(), a figure with a plot is shown as expected.

Strangely, when using a Python 2.7.5 interpreter embedded in Spyder (a scientific python IDE), interactive mode works as expected. If I run the startup script provided by Spyder (scientific_startup.py) in Python or IPython, it does not fix the issue, so I'm unsure where this difference in behavior is coming from. All three interpreters use the 'Qt4Agg' backend.

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