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


Python artist.get方法代碼示例

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


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

示例1: gca

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import get [as 別名]
def gca(**kwargs):
    """
    Get the current :class:`~matplotlib.axes.Axes` instance on the
    current figure matching the given keyword args, or create one.

    Examples
    ---------
    To get the current polar axes on the current figure::

        plt.gca(projection='polar')

    If the current axes doesn't exist, or isn't a polar one, the appropriate
    axes will be created and then returned.

    See Also
    --------
    matplotlib.figure.Figure.gca : The figure's gca method.
    """
    ax =  gcf().gca(**kwargs)
    return ax

# More ways of creating axes: 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:24,代碼來源:pyplot.py

示例2: gca

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import get [as 別名]
def gca(**kwargs):
    """
    Get the current :class:`~matplotlib.axes.Axes` instance on the
    current figure matching the given keyword args, or create one.

    Examples
    --------
    To get the current polar axes on the current figure::

        plt.gca(projection='polar')

    If the current axes doesn't exist, or isn't a polar one, the appropriate
    axes will be created and then returned.

    See Also
    --------
    matplotlib.figure.Figure.gca : The figure's gca method.
    """
    return gcf().gca(**kwargs)


## More ways of creating axes ## 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:24,代碼來源:pyplot.py

示例3: gca

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import get [as 別名]
def gca(**kwargs):
    """
    Get the current :class:`~matplotlib.axes.Axes` instance on the
    current figure matching the given keyword args, or create one.

    Examples
    --------
    To get the current polar axes on the current figure::

        plt.gca(projection='polar')

    If the current axes doesn't exist, or isn't a polar one, the appropriate
    axes will be created and then returned.

    See Also
    --------
    matplotlib.figure.Figure.gca : The figure's gca method.
    """
    return gcf().gca(**kwargs)

# More ways of creating axes: 
開發者ID:alvarobartt,項目名稱:twitter-stock-recommendation,代碼行數:23,代碼來源:pyplot.py

示例4: hold

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import get [as 別名]
def hold(b=None):
    """
    Set the hold state.  If *b* is None (default), toggle the
    hold state, else set the hold state to boolean value *b*::

      hold()      # toggle hold
      hold(True)  # hold is on
      hold(False) # hold is off

    When *hold* is *True*, subsequent plot commands will be added to
    the current axes.  When *hold* is *False*, the current axes and
    figure will be cleared on the next plot command.
    """

    fig = gcf()
    ax = fig.gca()

    fig.hold(b)
    ax.hold(b)

    # b=None toggles the hold state, so let's get get the current hold
    # state; but should pyplot hold toggle the rc setting - me thinks
    # not
    b = ax.ishold()

    rc('axes', hold=b) 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:28,代碼來源:pyplot.py

示例5: _autogen_docstring

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import get [as 別名]
def _autogen_docstring(base):
    """Autogenerated wrappers will get their docstring from a base function
    with an addendum."""
    msg = "\n\nAdditional kwargs: hold = [True|False] overrides default hold state"
    addendum = docstring.Appender(msg, '\n\n')
    return lambda func: addendum(docstring.copy_dedent(base)(func))

# This function cannot be generated by boilerplate.py because it may
# return an image or a line. 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:11,代碼來源:pyplot.py

示例6: _autogen_docstring

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import get [as 別名]
def _autogen_docstring(base):
    """Autogenerated wrappers will get their docstring from a base function
    with an addendum."""
    msg = ''
    addendum = docstring.Appender(msg, '\n\n')
    return lambda func: addendum(docstring.copy_dedent(base)(func))


# If rcParams['backend_fallback'] is true, and an interactive backend is
# requested, ignore rcParams['backend'] and force selection of a backend that
# is compatible with the current running interactive framework. 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:13,代碼來源:pyplot.py

示例7: gci

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import get [as 別名]
def gci():
    """
    Get the current colorable artist.  Specifically, returns the
    current :class:`~matplotlib.cm.ScalarMappable` instance (image or
    patch collection), or *None* if no images or patch collections
    have been defined.  The commands :func:`~matplotlib.pyplot.imshow`
    and :func:`~matplotlib.pyplot.figimage` create
    :class:`~matplotlib.image.Image` instances, and the commands
    :func:`~matplotlib.pyplot.pcolor` and
    :func:`~matplotlib.pyplot.scatter` create
    :class:`~matplotlib.collections.Collection` instances.  The
    current image is an attribute of the current axes, or the nearest
    earlier axes in the current figure that contains an image.

    Notes
    -----
    Historically, the only colorable artists were images; hence the name
    ``gci`` (get current image).
    """
    return gcf()._gci()


## Any Artist ##


# (getp is simply imported) 
開發者ID:boris-kz,項目名稱:CogAlg,代碼行數:28,代碼來源:pyplot.py

示例8: hold

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import get [as 別名]
def hold(b=None):
    """
    Set the hold state.  If *b* is None (default), toggle the
    hold state, else set the hold state to boolean value *b*::

      hold()      # toggle hold
      hold(True)  # hold is on
      hold(False) # hold is off

    When *hold* is *True*, subsequent plot commands will add elements to
    the current axes.  When *hold* is *False*, the current axes and
    figure will be cleared on the next plot command.

    """

    fig = gcf()
    ax = fig.gca()

    if b is not None:
        b = bool(b)
    fig._hold = b
    ax._hold = b

    # b=None toggles the hold state, so let's get get the current hold
    # state; but should pyplot hold toggle the rc setting - me thinks
    # not
    b = ax._hold

    # The comment above looks ancient; and probably the line below,
    # contrary to the comment, is equally ancient.  It will trigger
    # a second warning, but "Oh, well...".
    rc('axes', hold=b) 
開發者ID:alvarobartt,項目名稱:twitter-stock-recommendation,代碼行數:34,代碼來源:pyplot.py

示例9: _autogen_docstring

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import get [as 別名]
def _autogen_docstring(base):
    """Autogenerated wrappers will get their docstring from a base function
    with an addendum."""
    #msg = "\n\nAdditional kwargs: hold = [True|False] overrides default hold state"
    msg = ''
    addendum = docstring.Appender(msg, '\n\n')
    return lambda func: addendum(docstring.copy_dedent(base)(func))

# This function cannot be generated by boilerplate.py because it may
# return an image or a line. 
開發者ID:alvarobartt,項目名稱:twitter-stock-recommendation,代碼行數:12,代碼來源:pyplot.py

示例10: install_repl_displayhook

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import get [as 別名]
def install_repl_displayhook():
    """
    Install a repl display hook so that any stale figure are automatically
    redrawn when control is returned to the repl.

    This works both with IPython and with vanilla python shells.
    """
    global _IP_REGISTERED
    global _INSTALL_FIG_OBSERVER

    class _NotIPython(Exception):
        pass

    # see if we have IPython hooks around, if use them

    try:
        if 'IPython' in sys.modules:
            from IPython import get_ipython
            ip = get_ipython()
            if ip is None:
                raise _NotIPython()

            if _IP_REGISTERED:
                return

            def post_execute():
                if matplotlib.is_interactive():
                    draw_all()

            # IPython >= 2
            try:
                ip.events.register('post_execute', post_execute)
            except AttributeError:
                # IPython 1.x
                ip.register_post_execute(post_execute)

            _IP_REGISTERED = post_execute
            _INSTALL_FIG_OBSERVER = False

            # trigger IPython's eventloop integration, if available
            from IPython.core.pylabtools import backend2gui

            ipython_gui_name = backend2gui.get(get_backend())
            if ipython_gui_name:
                ip.enable_gui(ipython_gui_name)
        else:
            _INSTALL_FIG_OBSERVER = True

    # import failed or ipython is not running
    except (ImportError, _NotIPython):
        _INSTALL_FIG_OBSERVER = True 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:53,代碼來源:pyplot.py

示例11: install_repl_displayhook

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import get [as 別名]
def install_repl_displayhook():
    """
    Install a repl display hook so that any stale figure are automatically
    redrawn when control is returned to the repl.

    This works with IPython terminals and kernels,
    as well as vanilla python shells.
    """
    global _IP_REGISTERED
    global _INSTALL_FIG_OBSERVER

    class _NotIPython(Exception):
        pass

    # see if we have IPython hooks around, if use them

    try:
        if 'IPython' in sys.modules:
            from IPython import get_ipython
            ip = get_ipython()
            if ip is None:
                raise _NotIPython()

            if _IP_REGISTERED:
                return

            def post_execute():
                if matplotlib.is_interactive():
                    draw_all()

            # IPython >= 2
            try:
                ip.events.register('post_execute', post_execute)
            except AttributeError:
                # IPython 1.x
                ip.register_post_execute(post_execute)

            _IP_REGISTERED = post_execute
            _INSTALL_FIG_OBSERVER = False

            # trigger IPython's eventloop integration, if available
            from IPython.core.pylabtools import backend2gui

            ipython_gui_name = backend2gui.get(get_backend())
            if ipython_gui_name:
                ip.enable_gui(ipython_gui_name)
        else:
            _INSTALL_FIG_OBSERVER = True

    # import failed or ipython is not running
    except (ImportError, _NotIPython):
        _INSTALL_FIG_OBSERVER = True 
開發者ID:alvarobartt,項目名稱:twitter-stock-recommendation,代碼行數:54,代碼來源:pyplot.py


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