SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Emmanuel Favre-N. <man...@gm...> - 2007年05月29日 23:48:51
Hi,
I can plot only one time in windows. The second time, the window appears
without the tools and when I click on the windows it become white and
freezes. Here is a code :
from pylab import *
x=arange(5)
y=x*x
plot(x,y)
show()
plot(x,y)
show()
From: Jeff W. <js...@fa...> - 2007年05月30日 01:15:13
Emmanuel Favre-Nicolin wrote:
> Hi,
>
> I can plot only one time in windows. The second time, the window 
> appears without the tools and when I click on the windows it become 
> white and freezes. Here is a code :
>
> from pylab import *
> x=arange(5)
> y=x*x
> plot(x,y)
> show()
> plot(x,y)
> show()
Emmanuel:
Quoting from the the FAQ (http://matplotlib.sourceforge.net/faq.html):
" It is possible to force matplotlib to draw after every command, which 
is what you want in interactive mode 
<http://matplotlib.sourceforge.net/interactive.html>, but in a script 
you want to defer all drawing until the script has executed. This is 
especially important for complex figures that take some time to draw. 
'show' is designed to tell matplotlib that you're all done issuing 
commands and you want to draw the figure now. In the TkAgg backend, 
which can be used from an arbitrary python shell interactively, it also 
sets interactive mode. So you can launch your script with python -i 
myscript.py -dTkAgg and then change it interactively from the shell. 
IMPORTANT: show should called at most once per script and it should be 
the last line of your script. At that point, the GUI takes control of 
the interpreter. If you want to force a figure draw, use draw 
<http://matplotlib.sourceforge.net/matplotlib.pylab.html#-draw> instead."
-Jeff
 -- 
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449
325 Broadway Boulder, CO, USA 80305-3328
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 によって変換されたページ (->オリジナル) /