I am a newbie to python, numpy, and matplotlib, and I like what I have seen so far. I have been wishing for a long time there was an open alternative to matlab, and when I heard about numpy and matplotlib, I tried them out immediately.
Anyway, I am running python embedded in a C++ WX app. I just discovered matplotlib, so I tried it out. From the interactive python shell (vanilla FC5 linux install of python and matplotlib) everything works fine. The show() command blocks.
In my application, I use the PyRun_SimpleFile command to execute user selected python files on a separate thread. That has seemed to work fine for several weeks on scripts using numpy and such. When I use matplotlib, however, the show() command does not block, and then strange things happen when I try to close the Figure window. On the first close it reopens the window right back up. On the second close attempt it closes (gdb splits out zombie thread messages), and then if I try to execute another script with a show() command in it it sometimes seg faults, sometimes works, but in general causes my program to behave strangely.
So my question is: what is the correct way to setup python and/or matplotlib when running python embedded? Is there a way to make show() blocking when using embedded python (I am not sure this will solve any problems).