Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WxAgg hangs in interactive mode #1821

Closed
BrenBarn opened this issue Mar 12, 2013 · 4 comments
Closed

WxAgg hangs in interactive mode #1821

BrenBarn opened this issue Mar 12, 2013 · 4 comments

Comments

@BrenBarn
Copy link

I'm using 64-bit Windows 7 with matplotlib 1.2.0 and WxPython 2.8.12.1. I
was fiddling around with some of the different backends to see what
they look like and I found that the WxAgg backend doesn't work interactively:

Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> import matplotlib as mpl
 >>> mpl.use('WxAgg')
 >>> from matplotlib import pyplot
 >>> pyplot.ion()
 >>> pyplot.plot([1, 2, 3])
[<matplotlib.lines.Line2D object at 0x0000000006757DA0>]
 >>>

When I do the plot, the figure windows appears, but it's blank (without even a proper blank background, just the white area you get when a program goes on the fritz) and immediately shows "Not responding". I have to kill the window, and doing so crashes the Python session. However, it works without the "ion()" call: I can then call show() and see the plot fine.

I have wxPython working fine in other apps. In fact, what's especially odd is that I actually have an app that directly uses FigureCanvasWxAgg to embed matplotlib graphs in a GUI, and this seems to work fine. So it seems the problem is somehow in matplotlib's own management of the interactive figure window.

There was a previous question about a similar WxAgg issue on the list ( http://matplotlib.1069221.n5.nabble.com/trouble-with-show-not-drawing-in-interactive-mode-w-WxAgg-td39110.html ), but there was no real answer: the poster just decided not to use WxAgg. But aren't we really supposed to be able to use WxAgg interactively?

@pelson
Copy link
Member

pelson commented Mar 12, 2013

Thanks for raising @BrenBarn.

@cgohlke
Copy link
Contributor

cgohlke commented Mar 13, 2013

I can reproduce this issue. The same happens with the Wx backend. Looks like the event loop is not running.

@efiring
Copy link
Member

efiring commented Mar 13, 2013

The event loop is not running on Linux either unless one uses ipython --pylab=wx. I don't know that we ever guaranteed interactive support without IPython's help, though. IPython installs a custom PyOS_InputHook, and the one for wx is particularly elaborate. We have always left fiddling with the InputHook to IPython. All the ion() call does is to set a flag so that pyplot functions automatically draw. I think the other backends work without IPython because they have adequate PyOS_InputHook functions by default.

@efiring
Copy link
Member

efiring commented May 25, 2013

Based on my previous comment, I am removing the milestone and closing this.

@efiring efiring closed this as completed May 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants