[Tutor] Closing a matplotlib window after show()

Wayne Watson sierra_mtnview at sbcglobal.net
Tue Feb 9 06:53:39 CET 2010


Hi, I'm not so sure that's true. I have a large 900 line program where 
some original plot code just continues beyond plot() and show(), after 
the user closes the plot window. New code that I put in gets knotted up, 
as far as I can tell. In both cases, I've put print statements after 
show(), but nothing appears in the shell or, if run  by clicking the 
program file, in the DOS-like window that appears.

Further, I posted this elsewhere, and someone claims to have tried a few 
simple examples with show() at the ended,and they did not get tied up in 
knots when the user closed the window. I'm going to assume he used IDLE, 
or a  straight execute of the file.

On 2/8/2010 2:23 PM, Eike Welk wrote:
> 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.
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>    

-- 
"Crime is way down. War is declining. And that's far from the good 
news." -- Steven Pinker (and other sources) Why is this true, but yet 
the media says otherwise? The media knows very well how to manipulate us 
(see limbic, emotion, $$). -- WTW


More information about the Tutor mailing list