當前位置: 首頁>>代碼示例>>Python>>正文


Python Gcf.get_all_fig_managers方法代碼示例

本文整理匯總了Python中matplotlib._pylab_helpers.Gcf.get_all_fig_managers方法的典型用法代碼示例。如果您正苦於以下問題:Python Gcf.get_all_fig_managers方法的具體用法?Python Gcf.get_all_fig_managers怎麽用?Python Gcf.get_all_fig_managers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在matplotlib._pylab_helpers.Gcf的用法示例。


在下文中一共展示了Gcf.get_all_fig_managers方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: new_figure_manager_given_figure

# 需要導入模塊: from matplotlib._pylab_helpers import Gcf [as 別名]
# 或者: from matplotlib._pylab_helpers.Gcf import get_all_fig_managers [as 別名]
def new_figure_manager_given_figure(num, figure):
    """
    Create a new figure manager instance for the given figure.
    """
    canvas = FigureCanvasCocoaAgg(figure)
    return FigureManagerCocoaAgg(canvas, num)


## Below is the original show() function:
#def show():
#    for manager in Gcf.get_all_fig_managers():
#        manager.show()
#
## It appears that this backend is unusual in having a separate
## run function invoked for each figure, instead of a single
## mainloop.  Presumably there is no blocking at all.
##
## Using the Show class below should cause no difference in
## behavior. 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:21,代碼來源:backend_cocoaagg.py

示例2: show

# 需要導入模塊: from matplotlib._pylab_helpers import Gcf [as 別名]
# 或者: from matplotlib._pylab_helpers.Gcf import get_all_fig_managers [as 別名]
def show(close=None):
    """Show all figures as SVG/PNG payloads sent to the IPython clients.

    Parameters
    ----------
    close : bool, optional
      If true, a ``plt.close('all')`` call is automatically issued after
      sending all the figures. If this is set, the figures will entirely
      removed from the internal list of figures.
    """
    if close is None:
        close = InlineBackend.instance().close_figures
    try:
        for figure_manager in Gcf.get_all_fig_managers():
            display(figure_manager.canvas.figure)
    finally:
        show._to_draw = []
        if close:
            matplotlib.pyplot.close('all')



# This flag will be reset by draw_if_interactive when called 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:25,代碼來源:backend_inline.py

示例3: connection_info

# 需要導入模塊: from matplotlib._pylab_helpers import Gcf [as 別名]
# 或者: from matplotlib._pylab_helpers.Gcf import get_all_fig_managers [as 別名]
def connection_info():
    """
    Return a string showing the figure and connection status for the backend.

    This is intended as a diagnostic tool, and not for general use.
    """
    result = [
        '{fig} - {socket}'.format(
            fig=(manager.canvas.figure.get_label()
                 or "Figure {}".format(manager.num)),
            socket=manager.web_sockets)
        for manager in Gcf.get_all_fig_managers()
    ]
    if not is_interactive():
        result.append('Figures pending show: {}'.format(len(Gcf._activeQue)))
    return '\n'.join(result)


# Note: Version 3.2 and 4.x icons
# http://fontawesome.io/3.2.1/icons/
# http://fontawesome.io/
# the `fa fa-xxx` part targets font-awesome 4, (IPython 3.x)
# the icon-xxx targets font awesome 3.21 (IPython 2.x) 
開發者ID:PacktPublishing,項目名稱:Mastering-Elasticsearch-7.0,代碼行數:25,代碼來源:backend_nbagg.py

示例4: __call__

# 需要導入模塊: from matplotlib._pylab_helpers import Gcf [as 別名]
# 或者: from matplotlib._pylab_helpers.Gcf import get_all_fig_managers [as 別名]
def __call__(self, block=None):
        from matplotlib._pylab_helpers import Gcf
        from matplotlib import is_interactive

        managers = Gcf.get_all_fig_managers()
        if not managers:
            return

        interactive = is_interactive()

        for manager in managers:
            manager.show()

            # plt.figure adds an event which puts the figure in focus
            # in the activeQue. Disable this behaviour, as it results in
            # figures being put as the active figure after they have been
            # shown, even in non-interactive mode.
            if hasattr(manager, '_cidgcf'):
                manager.canvas.mpl_disconnect(manager._cidgcf)

            if not interactive and manager in Gcf._activeQue:
                Gcf._activeQue.remove(manager) 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:24,代碼來源:backend_nbagg.py

示例5: connection_info

# 需要導入模塊: from matplotlib._pylab_helpers import Gcf [as 別名]
# 或者: from matplotlib._pylab_helpers.Gcf import get_all_fig_managers [as 別名]
def connection_info():
    """
    Return a string showing the figure and connection status for
    the backend. This is intended as a diagnostic tool, and not for general
    use.

    """
    from matplotlib._pylab_helpers import Gcf
    result = []
    for manager in Gcf.get_all_fig_managers():
        fig = manager.canvas.figure
        result.append('{} - {}'.format((fig.get_label() or
                                        "Figure {0}".format(manager.num)),
                                       manager.web_sockets))
    result.append('Figures pending show: {}'.format(len(Gcf._activeQue)))
    return '\n'.join(result)


# Note: Version 3.2 and 4.x icons
# http://fontawesome.io/3.2.1/icons/
# http://fontawesome.io/
# the `fa fa-xxx` part targets font-awesome 4, (IPython 3.x)
# the icon-xxx targets font awesome 3.21 (IPython 2.x) 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:25,代碼來源:backend_nbagg.py

示例6: connection_info

# 需要導入模塊: from matplotlib._pylab_helpers import Gcf [as 別名]
# 或者: from matplotlib._pylab_helpers.Gcf import get_all_fig_managers [as 別名]
def connection_info():
    """
    Return a string showing the figure and connection status for
    the backend. This is intended as a diagnostic tool, and not for general
    use.

    """
    result = []
    for manager in Gcf.get_all_fig_managers():
        fig = manager.canvas.figure
        result.append('{0} - {0}'.format((fig.get_label() or
                                          "Figure {0}".format(manager.num)),
                                         manager.web_sockets))
    if not is_interactive():
        result.append('Figures pending show: {0}'.format(len(Gcf._activeQue)))
    return '\n'.join(result)


# Note: Version 3.2 and 4.x icons
# http://fontawesome.io/3.2.1/icons/
# http://fontawesome.io/
# the `fa fa-xxx` part targets font-awesome 4, (IPython 3.x)
# the icon-xxx targets font awesome 3.21 (IPython 2.x) 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:25,代碼來源:backend_nbagg.py

示例7: show

# 需要導入模塊: from matplotlib._pylab_helpers import Gcf [as 別名]
# 或者: from matplotlib._pylab_helpers.Gcf import get_all_fig_managers [as 別名]
def show(*args, **kwargs):
        ## TODO: something to do when keyword block==False ?
        from matplotlib._pylab_helpers import Gcf

        managers = Gcf.get_all_fig_managers()
        if not managers:
            return

        interactive = is_interactive()

        for manager in managers:
            manager.show()

            # plt.figure adds an event which puts the figure in focus
            # in the activeQue. Disable this behaviour, as it results in
            # figures being put as the active figure after they have been
            # shown, even in non-interactive mode.
            if hasattr(manager, '_cidgcf'):
                manager.canvas.mpl_disconnect(manager._cidgcf)

            if not interactive and manager in Gcf._activeQue:
                Gcf._activeQue.remove(manager) 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:24,代碼來源:backend_nbagg.py

示例8: show

# 需要導入模塊: from matplotlib._pylab_helpers import Gcf [as 別名]
# 或者: from matplotlib._pylab_helpers.Gcf import get_all_fig_managers [as 別名]
def show():
    """
    For image backends - is not required
    For GUI backends - show() is usually the last line of a pylab script and
    tells the backend that it is time to draw.  In interactive mode, this may
    be a do nothing func.  See the GTK backend for an example of how to handle
    interactive versus batch mode
    """
    for manager in Gcf.get_all_fig_managers():
        # do something to display the GUI
        pass 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:13,代碼來源:backend_template.py

示例9: show

# 需要導入模塊: from matplotlib._pylab_helpers import Gcf [as 別名]
# 或者: from matplotlib._pylab_helpers.Gcf import get_all_fig_managers [as 別名]
def show(cls, block=None):
        """
        Show all figures.

        `show` blocks by calling `mainloop` if *block* is ``True``, or if it
        is ``None`` and we are neither in IPython's ``%pylab`` mode, nor in
        `interactive` mode.
        """
        managers = Gcf.get_all_fig_managers()
        if not managers:
            return
        for manager in managers:
            # Emits a warning if the backend is non-interactive.
            manager.canvas.figure.show()
        if cls.mainloop is None:
            return
        if block is None:
            # Hack: Are we in IPython's pylab mode?
            from matplotlib import pyplot
            try:
                # IPython versions >= 0.10 tack the _needmain attribute onto
                # pyplot.show, and always set it to False, when in %pylab mode.
                ipython_pylab = not pyplot.show._needmain
            except AttributeError:
                ipython_pylab = False
            block = not ipython_pylab and not is_interactive()
            # TODO: The above is a hack to get the WebAgg backend working with
            # ipython's `%pylab` mode until proper integration is implemented.
            if get_backend() == "WebAgg":
                block = True
        if block:
            cls.mainloop()

    # This method is the one actually exporting the required methods. 
開發者ID:PacktPublishing,項目名稱:Mastering-Elasticsearch-7.0,代碼行數:36,代碼來源:backend_bases.py

示例10: show

# 需要導入模塊: from matplotlib._pylab_helpers import Gcf [as 別名]
# 或者: from matplotlib._pylab_helpers.Gcf import get_all_fig_managers [as 別名]
def show(*args, block=None, **kwargs):
        if args or kwargs:
            cbook.warn_deprecated(
                "3.1", message="Passing arguments to show(), other than "
                "passing 'block' by keyword, is deprecated %(since)s, and "
                "support for it will be removed %(removal)s.")

        ## TODO: something to do when keyword block==False ?
        from matplotlib._pylab_helpers import Gcf

        managers = Gcf.get_all_fig_managers()
        if not managers:
            return

        interactive = is_interactive()

        for manager in managers:
            manager.show()

            # plt.figure adds an event which puts the figure in focus
            # in the activeQue. Disable this behaviour, as it results in
            # figures being put as the active figure after they have been
            # shown, even in non-interactive mode.
            if hasattr(manager, '_cidgcf'):
                manager.canvas.mpl_disconnect(manager._cidgcf)

            if not interactive and manager in Gcf._activeQue:
                Gcf._activeQue.remove(manager) 
開發者ID:PacktPublishing,項目名稱:Mastering-Elasticsearch-7.0,代碼行數:30,代碼來源:backend_nbagg.py

示例11: show

# 需要導入模塊: from matplotlib._pylab_helpers import Gcf [as 別名]
# 或者: from matplotlib._pylab_helpers.Gcf import get_all_fig_managers [as 別名]
def show(*, block=None):
    """
    For image backends - is not required.
    For GUI backends - show() is usually the last line of a pyplot script and
    tells the backend that it is time to draw.  In interactive mode, this
    should do nothing.
    """
    for manager in Gcf.get_all_fig_managers():
        # do something to display the GUI
        pass 
開發者ID:PacktPublishing,項目名稱:Mastering-Elasticsearch-7.0,代碼行數:12,代碼來源:backend_template.py

示例12: mainloop

# 需要導入模塊: from matplotlib._pylab_helpers import Gcf [as 別名]
# 或者: from matplotlib._pylab_helpers.Gcf import get_all_fig_managers [as 別名]
def mainloop():
        managers = Gcf.get_all_fig_managers()
        if managers:
            managers[0].window.mainloop() 
開發者ID:PacktPublishing,項目名稱:Mastering-Elasticsearch-7.0,代碼行數:6,代碼來源:_backend_tk.py

示例13: show

# 需要導入模塊: from matplotlib._pylab_helpers import Gcf [as 別名]
# 或者: from matplotlib._pylab_helpers.Gcf import get_all_fig_managers [as 別名]
def show(cls, block=None):
        """Show all figures.

        `show` blocks by calling `mainloop` if *block* is ``True``, or if it
        is ``None`` and we are neither in IPython's ``%pylab`` mode, nor in
        `interactive` mode.
        """
        managers = Gcf.get_all_fig_managers()
        if not managers:
            return
        for manager in managers:
            # Emits a warning if the backend is non-interactive.
            manager.canvas.figure.show()
        if cls.mainloop is None:
            return
        if block is None:
            # Hack: Are we in IPython's pylab mode?
            from matplotlib import pyplot
            try:
                # IPython versions >= 0.10 tack the _needmain attribute onto
                # pyplot.show, and always set it to False, when in %pylab mode.
                ipython_pylab = not pyplot.show._needmain
            except AttributeError:
                ipython_pylab = False
            block = not ipython_pylab and not is_interactive()
            # TODO: The above is a hack to get the WebAgg backend working with
            # ipython's `%pylab` mode until proper integration is implemented.
            if get_backend() == "WebAgg":
                block = True
        if block:
            cls.mainloop()

    # This method is the one actually exporting the required methods. 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:35,代碼來源:backend_bases.py

示例14: show

# 需要導入模塊: from matplotlib._pylab_helpers import Gcf [as 別名]
# 或者: from matplotlib._pylab_helpers.Gcf import get_all_fig_managers [as 別名]
def show(block=None):
    """
    For image backends - is not required.
    For GUI backends - show() is usually the last line of a pyplot script and
    tells the backend that it is time to draw.  In interactive mode, this
    should do nothing.
    """
    for manager in Gcf.get_all_fig_managers():
        # do something to display the GUI
        pass 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:12,代碼來源:backend_template.py


注:本文中的matplotlib._pylab_helpers.Gcf.get_all_fig_managers方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。