wxpython as GUI problem

Hello I write a program which launch pylab from windows GUI

    > (using wxpython). I found some problem here.

    ...snip...

    > What's the problem here. I use pylab.show() to show the
    > program. I use windows xp sp2

If I am reading your post correctly, you are writing a wxpython
application and trying to use pylab from it. Don't: it won't work and
is not expected to work. pylab starts the mainloop of the GUI for the
backend you have chosen, and this will conflict with the wxpython
mainloop of your program. You need to use the matplotlib API and
manage your own Figure windows. See

  http://matplotlib.sf.net/faq.html#OO

and the examples/embedding_in_wx*.py in the matplotlib src
distribution.

Matt Newville has also posted lots of examples and helper code at
http://cars.uchicago.edu/~newville/Python/MPlot which make it easier
to use matplotlib in wx apps.

JDH

thanks john,

That's clear now.

pujo

···

On 7/28/05, John Hunter <jdhunter@...4...> wrote:

    > Hello I write a program which launch pylab from windows GUI
    > (using wxpython). I found some problem here.

    ...snip...

    > What's the problem here. I use pylab.show() to show the
    > program. I use windows xp sp2

If I am reading your post correctly, you are writing a wxpython
application and trying to use pylab from it. Don't: it won't work and
is not expected to work. pylab starts the mainloop of the GUI for the
backend you have chosen, and this will conflict with the wxpython
mainloop of your program. You need to use the matplotlib API and
manage your own Figure windows. See

  http://matplotlib.sf.net/faq.html#OO

and the examples/embedding_in_wx*.py in the matplotlib src
distribution.

Matt Newville has also posted lots of examples and helper code at
http://cars.uchicago.edu/~newville/Python/MPlot which make it easier
to use matplotlib in wx apps.

JDH