SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Lee, Young-J. <yo...@uc...> - 2007年09月26日 17:39:27
Hi,
=20
I 'm writing a python program that draws figures one by one
interactively with the user's input in dos mode. Basically, I give the
program a decision after each figure and then it draws the next one.
After the first figure, it got very much slowed down for the second one
and crashed for the third one. I feel like it has some memory issues as
I keep using 'show' after I close each. I used 'clf()' before I draw a
new one, but it doesn't seem to help. Any idea? Thanks.
=20
Young Jin
From: Wolfgang K. <wke...@go...> - 2007年09月27日 04:03:26
This might help you it destroys the whole window:
pylab.get_current_fig_manager().destroy()
and then you open it again with show
Lee, Young-Jin wrote:
>
> Hi,
>
> I ’m writing a python program that draws figures one by one 
> interactively with the user’s input in dos mode. Basically, I give the 
> program a decision after each figure and then it draws the next one. 
> After the first figure, it got very much slowed down for the second 
> one and crashed for the third one. I feel like it has some memory 
> issues as I keep using ‘show’ after I close each. I used ‘clf()’ 
> before I draw a new one, but it doesn’t seem to help. Any idea? Thanks.
>
> Young Jin
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> ------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
From: Lee, Young-J. <yo...@uc...> - 2007年09月27日 11:26:22
Thanks much! But, it didn't help. The second figure got still really
slow and closes right away after it finishes drawing not giving enough
time to me to see the figure. Then, it crashed for the third one. Any
idea?
Young Jin
-----Original Message-----
From: Wolfgang Kerzendorf [mailto:wke...@go...]=20
Sent: Wednesday, September 26, 2007 9:03 PM
To: Lee, Young-Jin
Cc: mat...@li...
Subject: Re: [Matplotlib-users] multiple figures interactively
This might help you it destroys the whole window:
pylab.get_current_fig_manager().destroy()
and then you open it again with show
Lee, Young-Jin wrote:
>
> Hi,
>
> I 'm writing a python program that draws figures one by one=20
> interactively with the user's input in dos mode. Basically, I give the
> program a decision after each figure and then it draws the next one.=20
> After the first figure, it got very much slowed down for the second=20
> one and crashed for the third one. I feel like it has some memory=20
> issues as I keep using 'show' after I close each. I used 'clf()'=20
> before I draw a new one, but it doesn't seem to help. Any idea?
Thanks.
>
> Young Jin
>
>
------------------------------------------------------------------------
>
>
------------------------------------------------------------------------
-
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>
------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> =20
From: Lee, Young-J. <yo...@uc...> - 2007年10月01日 06:47:46
Folks, I need your help. I'll explain a little further what happens.
Following is a test program,'test.py', and screen shot of the error
message. Here, 'test.py' is simple chart of sinusoidal function in
http://matplotlib.sourceforge.net/screenshots.html (simple_plot.py), but
have two of them in series. I tried Wolfgang's suggestion but it doesn't
help. Any idea?
Test.py:
from pylab import *
t =3D arange(0.0, 2.0, 0.01)
s =3D sin(2*pi*t)
plot(t, s, linewidth=3D1.0)
xlabel('time (s)')
ylabel('voltage (mV)')
title('About as simple as it gets, folks')
grid(True)
show()
clf()
t =3D arange(0.0, 2.0, 0.01)
s =3D sin(2*pi*t)
plot(t, s, linewidth=3D1.0)
xlabel('time (s)')
ylabel('voltage (mV)')
title('About as simple as it gets, folks')
grid(True)
show()
Execution of test.py:
c:\Python24>python test.py
c:\Python24\lib\site-packages\matplotlib\numerix\__init__.py:53:
DeprecationWarn
ing: numarray use as a numerix backed for matplotlib is deprecated
 DeprecationWarning, stacklevel=3D1)
Fatal Python error: PyEval_RestoreThread: NULL tstate
This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.
c:\Python24>
-----Original Message-----
From: Wolfgang Kerzendorf [mailto:wke...@go...]=20
Sent: Wednesday, September 26, 2007 9:03 PM
To: Lee, Young-Jin
Cc: mat...@li...
Subject: Re: [Matplotlib-users] multiple figures interactively
This might help you it destroys the whole window:
pylab.get_current_fig_manager().destroy()
and then you open it again with show
Lee, Young-Jin wrote:
>
> Hi,
>
> I 'm writing a python program that draws figures one by one=20
> interactively with the user's input in dos mode. Basically, I give the
> program a decision after each figure and then it draws the next one.=20
> After the first figure, it got very much slowed down for the second=20
> one and crashed for the third one. I feel like it has some memory=20
> issues as I keep using 'show' after I close each. I used 'clf()'=20
> before I draw a new one, but it doesn't seem to help. Any idea?
Thanks.
>
> Young Jin
>
>
------------------------------------------------------------------------
>
>
------------------------------------------------------------------------
-
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>
------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> =20
From: Jeff W. <js...@fa...> - 2007年10月01日 19:16:50
Lee, Young-Jin wrote:
> Folks, I need your help. I'll explain a little further what happens.
> Following is a test program,'test.py', and screen shot of the error
> message. Here, 'test.py' is simple chart of sinusoidal function in
> http://matplotlib.sourceforge.net/screenshots.html (simple_plot.py), but
> have two of them in series. I tried Wolfgang's suggestion but it doesn't
> help. Any idea?
>
> Test.py:
>
> from pylab import *
>
> t = arange(0.0, 2.0, 0.01)
> s = sin(2*pi*t)
> plot(t, s, linewidth=1.0)
>
> xlabel('time (s)')
> ylabel('voltage (mV)')
> title('About as simple as it gets, folks')
> grid(True)
> show()
>
> clf()
> t = arange(0.0, 2.0, 0.01)
> s = sin(2*pi*t)
> plot(t, s, linewidth=1.0)
>
> xlabel('time (s)')
> ylabel('voltage (mV)')
> title('About as simple as it gets, folks')
> grid(True)
> show()
> 
Young-Jin: 
You can't have two "show()"s in one script. Comment out the first one, 
and replace the "clf()" with "figure()" and all is well.
Or, use "draw()".
See http://matplotlib.sourceforge.net/faq.html#SHOW for details.
-Jeff
>
> Execution of test.py:
>
> c:\Python24>python test.py
> c:\Python24\lib\site-packages\matplotlib\numerix\__init__.py:53:
> DeprecationWarn
> ing: numarray use as a numerix backed for matplotlib is deprecated
> DeprecationWarning, stacklevel=1)
> Fatal Python error: PyEval_RestoreThread: NULL tstate
>
> This application has requested the Runtime to terminate it in an unusual
> way.
> Please contact the application's support team for more information.
>
> c:\Python24>
>
> -----Original Message-----
> From: Wolfgang Kerzendorf [mailto:wke...@go...] 
> Sent: Wednesday, September 26, 2007 9:03 PM
> To: Lee, Young-Jin
> Cc: mat...@li...
> Subject: Re: [Matplotlib-users] multiple figures interactively
>
> This might help you it destroys the whole window:
> pylab.get_current_fig_manager().destroy()
> and then you open it again with show
> Lee, Young-Jin wrote:
> 
>> Hi,
>>
>> I 'm writing a python program that draws figures one by one 
>> interactively with the user's input in dos mode. Basically, I give the
>> 
>
> 
>> program a decision after each figure and then it draws the next one. 
>> After the first figure, it got very much slowed down for the second 
>> one and crashed for the third one. I feel like it has some memory 
>> issues as I keep using 'show' after I close each. I used 'clf()' 
>> before I draw a new one, but it doesn't seem to help. Any idea?
>> 
> Thanks.
> 
>> Young Jin
>>
>>
>> 
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /