On Wed, Aug 19, 2009 at 11:55 AM, coati <dwki...@gmail.com> wrote:

>
>  I have a problem with show() command in my macbook machine (Leopard
> 10.5.8).
> For example, if I run the script shown below
> (let assume it is saved as 'test.py', and I run a command 'python
> test.py'),
>
> ---------------------------------------
>
> plot([1,2,3,4,5])
> show() #first window
> plot([1,2,3,4,5])
> show() #second window
> plot([1,2,3,4,5])
> show() #third window
>
> ---------------------------------------
>
> Then the first window just pops up and I can see a beautiful straight line
> :) No problem so far.
> But, after I close the first window by clicking the close button of the
> window,
> other two window (second and third) just pops up and close themselves
> instantly
> even though I didn't click the close button...
> Also, the second and third plot is shown in the same window.
>
> I don't have such problem in my Ubuntu machine..
>
> Does anybody know reasons?


show() actually handles starting the GUI mainloop, so you really shouldn't
be calling it more than once from a script.  Quite frankly, it's more
amazing that it works on your Ubuntu macine. :)  If you're wanting 3
separate windows, try:

plot([1,2,3,4,5])
figure()
plot([1,2,3,4,5])
figure()
plot([1,2,3,4,5])
show()

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to