trouble with show() not drawing in interactive mode w/ WxAgg

Hi all,
  I've been having some trouble getting interactive mode to work
correctly with the WxAgg backend. I have these versions:

[craigb@...4216... hists]$ python
Python 2.7.3 (default, Aug 13 2012, 16:13:38)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import matplotlib
matplotlib.__version__

'1.1.1rc'

import wx
wx.__version__

'2.8.12.1'

When I do something like this,

from matplotlib import pyplot
import numpy
pyplot.plot(numpy.arange(10), numpy.arange(10), 'r.')

[<matplotlib.lines.Line2D object at 0x5561750>]

pyplot.show()

I get a good-looking window with my plot. I can mouse over the window
and get coordinates, there are buttons on the bottom of the window
that I can push, etc. However, if I turn on interactive mode (I read
somewhere that it's bad to turn on interactive mode after you've
already made a plot, so below I've exited and started a new
interactive session),

from matplotlib import pyplot
import numpy
pyplot.ion()
pyplot.plot(numpy.arange(10), numpy.arange(10), 'r.')

[<matplotlib.lines.Line2D object at 0x153e2ad0>]

Nothing shows at this point. If I continue,

pyplot.show()

Still nothing shows. If I exit right now, I get a brief glimpse of my
plot before python exits completely. I can get the plot to show by
doing

pyplot.draw()

But it's only the top half of the plot, and if I drag another window
on top of it, it doesn't automatically redraw. No buttons, no
mouse-over niceness. Issuing pyplot.draw() again gets me the full
plot, but no mouse-overs, no buttons, and no redraw.

Both MPL and wxPython were built from source on a RHEL5.8 machine, so
maybe it's the libraries I am linking against...? Anyway, I've
attached two screenshots of what my plots look like when they finally
are drawn. Many many thanks in advance!

--cb

second_draw.png

first_draw.png

So I rebuilt Python so that I would have Tkinter support, and using
TkAgg I get the behavior I want, so it's not mission critical to me to
figure this out anymore. But if anyone is interested in tracking it
down I will be glad to help.

···

On Wed, Sep 26, 2012 at 8:06 AM, Craig the Demolishor <destroooooy@...287...> wrote:

Hi all,
  I've been having some trouble getting interactive mode to work
correctly with the WxAgg backend. I have these versions:

[craigb@...4216... hists]$ python
Python 2.7.3 (default, Aug 13 2012, 16:13:38)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import matplotlib
matplotlib.__version__

'1.1.1rc'

import wx
wx.__version__

'2.8.12.1'

When I do something like this,

from matplotlib import pyplot
import numpy
pyplot.plot(numpy.arange(10), numpy.arange(10), 'r.')

[<matplotlib.lines.Line2D object at 0x5561750>]

pyplot.show()

I get a good-looking window with my plot. I can mouse over the window
and get coordinates, there are buttons on the bottom of the window
that I can push, etc. However, if I turn on interactive mode (I read
somewhere that it's bad to turn on interactive mode after you've
already made a plot, so below I've exited and started a new
interactive session),

from matplotlib import pyplot
import numpy
pyplot.ion()
pyplot.plot(numpy.arange(10), numpy.arange(10), 'r.')

[<matplotlib.lines.Line2D object at 0x153e2ad0>]

Nothing shows at this point. If I continue,

pyplot.show()

Still nothing shows. If I exit right now, I get a brief glimpse of my
plot before python exits completely. I can get the plot to show by
doing

pyplot.draw()

But it's only the top half of the plot, and if I drag another window
on top of it, it doesn't automatically redraw. No buttons, no
mouse-over niceness. Issuing pyplot.draw() again gets me the full
plot, but no mouse-overs, no buttons, and no redraw.

Both MPL and wxPython were built from source on a RHEL5.8 machine, so
maybe it's the libraries I am linking against...? Anyway, I've
attached two screenshots of what my plots look like when they finally
are drawn. Many many thanks in advance!

--cb