本文整理汇总了Python中matplotlib.backend_bases.FigureManagerBase._cidgcf方法的典型用法代码示例。如果您正苦于以下问题:Python FigureManagerBase._cidgcf方法的具体用法?Python FigureManagerBase._cidgcf怎么用?Python FigureManagerBase._cidgcf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.backend_bases.FigureManagerBase
的用法示例。
在下文中一共展示了FigureManagerBase._cidgcf方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from matplotlib.backend_bases import FigureManagerBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureManagerBase import _cidgcf [as 别名]
def __init__(self, *args, **kwargs):
# pull non-standard keyword arguments
refresh = kwargs.pop('auto_refresh', False)
# dynamically set the subplot positions based on the figure size
# -- only if the user hasn't customised the subplot params
figsize = kwargs.get('figsize', rcParams['figure.figsize'])
subplotpars = get_subplot_params(figsize)
use_subplotpars = 'subplotpars' not in kwargs and all([
rcParams['figure.subplot.%s' % pos] ==
MPL_RCPARAMS['figure.subplot.%s' % pos] for
pos in ('left', 'bottom', 'right', 'top')])
if use_subplotpars:
kwargs['subplotpars'] = subplotpars
# generated figure, with associated interactivity from pyplot
super(Plot, self).__init__(*args, **kwargs)
backend_mod, _, draw_if_interactive, _ = backends.pylab_setup()
try:
manager = backend_mod.new_figure_manager_given_figure(1, self)
except AttributeError:
canvas = backend_mod.FigureCanvas(self)
manager = FigureManagerBase(canvas, 1)
cid = manager.canvas.mpl_connect(
'button_press_event',
lambda ev: _pylab_helpers.Gcf.set_active(manager))
manager._cidgcf = cid
_pylab_helpers.Gcf.set_active(manager)
draw_if_interactive()
# finalise
self.set_auto_refresh(refresh)
self.colorbars = []
self._coloraxes = []
示例2: __init__
# 需要导入模块: from matplotlib.backend_bases import FigureManagerBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureManagerBase import _cidgcf [as 别名]
def __init__(self, *args, **kwargs):
# pull non-standard keyword arguments
auto_refresh = kwargs.pop("auto_refresh", False)
# generated figure, with associated interactivity from pyplot
super(Plot, self).__init__(*args, **kwargs)
backend_mod, _, draw_if_interactive, _ = backends.pylab_setup()
try:
manager = backend_mod.new_figure_manager_given_figure(1, self)
except AttributeError:
canvas = backend_mod.FigureCanvas(self)
manager = FigureManagerBase(canvas, 1)
cid = manager.canvas.mpl_connect("button_press_event", lambda ev: _pylab_helpers.Gcf.set_active(manager))
manager._cidgcf = cid
_pylab_helpers.Gcf.set_active(manager)
draw_if_interactive()
# finalise
self.set_auto_refresh(auto_refresh)
self.colorbars = []
self._coloraxes = []