小编ale*_*lov的帖子

通过 Matplotlib 中的 OO 接口获取图形管理器

我希望能够获得创建的图形的 figure_manager:例如,我可以使用 pyplot 界面使用:

from pylab import*
figure()    
plot(arange(100))
mngr = get_current_fig_manager()
Run Code Online (Sandbox Code Playgroud)

但是,如果我有几个数字怎么办:

from pylab import *
fig0 = figure()
fig1 = figure()    
plot(arange(100))
mngr = fig0.get_manager() #DOES NOT WORK - no such method as Figure.get_manager()
Run Code Online (Sandbox Code Playgroud)

但是,仔细搜索图形 API http://matplotlib.org/api/figure_api.html并没有用。我的 IDE 中的图形实例也没有自动完成,似乎没有任何方法/成员给我一个“管理器”。

那么我该如何做到这一点,一般来说,如果有一个 pyplot 方法,我需要在 OO 界面中使用它的模拟方法,我应该在哪里查看?

PS:无论如何,get_current_fig_manager() 返回什么样的对象?在调试器中,我得到:

type(get_current_fig_manager())
<type 'instance'>
Run Code Online (Sandbox Code Playgroud)

这听起来很神秘......

matplotlib figure

7
推荐指数
1
解决办法
3368
查看次数

标签 统计

figure ×1

matplotlib ×1