SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: nobody <dai...@bu...> - 2008年07月31日 18:39:12
Two questions for using Matplotlib (via interactive Python prompt, not pylab
interface):
1) How can I get a list of the currently extant figures?
 -- In Matlab, I would just type "get(0,'children')" -- how would
Matplotlib handle this?
2) How can I test if a specified figure exists?
 
Thanks, --Ian
-----
I am a BugMeNot account and postings from this user may not always be from
the same person.
-- 
View this message in context: http://www.nabble.com/Figure-existence-test-tp18760841p18760841.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: nobody <dai...@bu...> - 2008年08月11日 21:24:07
Bump... Does no-one have a solution for this?
-----
I am a BugMeNot account and postings from this user may not always be from
the same person.
-- 
View this message in context: http://www.nabble.com/Figure-existence-test-tp18760841p18934165.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: John H. <jd...@gm...> - 2008年08月11日 22:55:58
On Mon, Aug 11, 2008 at 4:24 PM, nobody <dai...@bu...> wrote:
>
> Bump... Does no-one have a solution for this?
Sorry for not answering. There is no elegant way to do this so we
should add support. In the meantime, the following hack should work
 >>> figs = [manager.canvas.figure for manager in
pylab._pylab_helpers.Gcf.get_all_fig_managers()]
And you asked about testing to see if a figure exists -- do you mean
by figure number? If so, you could check a number against the "num"
attribute from the figure list
 >>> somenum in [fig.num for fig in figs]
JDH
From: nobody <dai...@bu...> - 2008年08月13日 06:50:38
Thank you -- this is what I was looking for. The only issue is that my "fig"
objects have no "num" attribute -- it is called "number" instead. So if I
use this, instead, it works fine:
 >>> somenum in [fig.number for fig in figs]
-Ian
-----
I am a BugMeNot account and postings from this user may not always be from
the same person.
-- 
View this message in context: http://www.nabble.com/Figure-existence-test-tp18760841p18957882.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
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 によって変換されたページ (->オリジナル) /