当前位置: 首页>>代码示例>>Python>>正文


Python FigureManagerBase._cidgcf方法代码示例

本文整理汇总了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 = []
开发者ID:stefco,项目名称:gwpy,代码行数:36,代码来源:core.py

示例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 = []
开发者ID:e-q,项目名称:gwpy,代码行数:23,代码来源:core.py


注:本文中的matplotlib.backend_bases.FigureManagerBase._cidgcf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。