Running matplotlib as a separate thread

Hi everybody!

I am new to matplotlib and I have a question. I am running matplotlib from a main program in python as a separate thread. When I first launch matplotlib it works fine. On my second try when the main program is still running I try to execute it again but the plotting window is shown only for a sec and then it disappears. The last command is show(). This show() command should block the thread from dying and should unblock, leave the thread to die, when I close the matplotlib plotting window. Somehow this doesn't happen. Any clues on how I can fix this? Maybe I should be using something else then show() method?

Manny thanks!

Cheers, Dragan.