[Matplotlib-users] How to close the figure after show it?
Hi All,I am using matplotlab to plot some figure. I would like to close the figure after show it 5 sec. My code is pasted below. However, I can not close the figure automatically. Can anyone help me to fix it?Thanks,Brook==import timefrom pylab import *from matplotlib import *x=**y=**x2=**y2=***figure()hold(True)plot(x,y)plot(x2,y2,'g^')axis([0, 100, 0, 100])title('Pylab plot')xlabel('X')ylabel('Y')grid()pylab.show()time.sleep(5)pylab.close() Looking for last minute shopping deals? Find them fast with Yahoo! Search. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How to close the figure after show it?
I think f = figure(); ... pylab.close(f); should work. --Mike On Mar 20, 2008, at 2:14 PM, Fans Gnu wrote: Hi All, I am using matplotlab to plot some figure. I would like to close the figure after show it 5 sec. My code is pasted below. However, I can not close the figure automatically. Can anyone help me to fix it? Thanks, Brook == import time from pylab import * from matplotlib import * x=** y=** x2=** y2=*** figure() hold(True) plot(x,y) plot(x2,y2,'g^') axis([0, 100, 0, 100]) title('Pylab plot') xlabel('X') ylabel('Y') grid() pylab.show() time.sleep(5) pylab.close() Looking for last minute shopping deals? Find them fast with Yahoo! Search. -- --- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Hearne [EMAIL PROTECTED] (303) 273-8620 USGS National Earthquake Information Center 1711 Illinois St. Golden CO 80401 Senior Software Engineer Synergetics, Inc. -- - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How to close the figure after show it?
Hi, Hi Mike,thanks for your reply. I tried f=figure() and pylab.close(f), but the figure can not be closed automatically. Seems that time.sleep(3) doesn't be called until I close the figure manually. Maybe try setting the figure's interactive property to on? -- Chris - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How to close the figure after show it?
Can you give me a simple example to show how to set the figure's interactive property to on? I appreciate!--Brook--- On Fri, 3/21/08, Christopher Brown [EMAIL PROTECTED] wrote:From: Christopher Brown [EMAIL PROTECTED]Subject: Re: [Matplotlib-users] How to close the figure after show it?To: [EMAIL PROTECTED]Cc: matplotlib-users@lists.sourceforge.netDate: Friday, March 21, 2008, 12:19 AMHi, Hi Mike,thanks for your reply. I tried f=figure() and pylab.close(f), but the figure can not be closed automatically. Seems that time.sleep(3) doesn't be called until I close the figure manually.Maybe try setting the figure's interactive property to on?-- Chris Looking for last minute shopping deals? Find them fast with Yahoo! Search. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How to close the figure after show it?
Hi Brook, FG Can you give me a simple example to show how to set the figure's FG interactive property to on? I appreciate! import pylab pylab.ion() -- Chris - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users