[Tutor] Closing a matplotlib window after show()

Eike Welk eike.welk at gmx.net
Mon Feb 8 23:23:09 CET 2010


Hello Wayne!

On Monday February 8 2010 20:54:27 Wayne Watson wrote:
> The basic problem is the show(). One person checked out the examples I
> provided and found show() to operate fine. On my XP machine the program
> I'm modifying has plot code someone put in a year or two ago, and it all
> works fine. My code produces the desired plot, but gets hung up on show().

The behavior that you describe, is the normal behavior of Matplotlib: When you 
call show(), the program gets stuck. 

Therefore the call to show is always the last statement in the example 
programs. Show returns when the last plot window is closed, and in principle 
the program could then continue. 

If you want to look at plots while the program is running, you must use 
Ipython. This is a modified Python interpreter, that contains special code to 
change the way how Matplotlib works. 

http://ipython.scipy.org/moin/


Eike.


More information about the Tutor mailing list