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


Python Axes.imshow方法代碼示例

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


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

示例1: clim

# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import imshow [as 別名]
def clim(vmin=None, vmax=None):
    """
    Set the color limits of the current image.

    To apply clim to all axes images do::

      clim(0, 0.5)

    If either *vmin* or *vmax* is None, the image min/max respectively
    will be used for color scaling.

    If you want to set the clim of multiple images,
    use, for example::

      for im in gca().get_images():
          im.set_clim(0, 0.05)

    """
    im = gci()
    if im is None:
        raise RuntimeError('You must first define an image, eg with imshow')

    im.set_clim(vmin, vmax)
    draw_if_interactive() 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:26,代碼來源:pyplot.py

示例2: imshow

# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import imshow [as 別名]
def imshow(X, cmap=None, norm=None, aspect=None, interpolation=None, alpha=None,
           vmin=None, vmax=None, origin=None, extent=None, shape=None,
           filternorm=1, filterrad=4.0, imlim=None, resample=None, url=None,
           hold=None, **kwargs):
    ax = gca()
    # allow callers to override the hold state by passing hold=True|False
    washold = ax.ishold()

    if hold is not None:
        ax.hold(hold)
    try:
        ret = ax.imshow(X, cmap=cmap, norm=norm, aspect=aspect,
                        interpolation=interpolation, alpha=alpha, vmin=vmin,
                        vmax=vmax, origin=origin, extent=extent, shape=shape,
                        filternorm=filternorm, filterrad=filterrad,
                        imlim=imlim, resample=resample, url=url, **kwargs)
        draw_if_interactive()
    finally:
        ax.hold(washold)
    sci(ret)
    return ret

# This function was autogenerated by boilerplate.py.  Do not edit as
# changes will be lost 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:26,代碼來源:pyplot.py

示例3: clim

# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import imshow [as 別名]
def clim(vmin=None, vmax=None):
    """
    Set the color limits of the current image.

    To apply clim to all axes images do::

      clim(0, 0.5)

    If either *vmin* or *vmax* is None, the image min/max respectively
    will be used for color scaling.

    If you want to set the clim of multiple images,
    use, for example::

      for im in gca().get_images():
          im.set_clim(0, 0.05)

    """
    im = gci()
    if im is None:
        raise RuntimeError('You must first define an image, e.g., with imshow')

    im.set_clim(vmin, vmax)
    draw_if_interactive() 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:26,代碼來源:pyplot.py

示例4: gci

# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import imshow [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.
    """
    return gcf()._gci()


## Any Artist ##


# (getp is simply imported) 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:23,代碼來源:pyplot.py

示例5: clim

# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import imshow [as 別名]
def clim(vmin=None, vmax=None):
    """
    Set the color limits of the current image.

    To apply clim to all axes images do::

      clim(0, 0.5)

    If either *vmin* or *vmax* is None, the image min/max respectively
    will be used for color scaling.

    If you want to set the clim of multiple images,
    use, for example::

      for im in gca().get_images():
          im.set_clim(0, 0.05)

    """
    im = gci()
    if im is None:
        raise RuntimeError('You must first define an image, e.g., with imshow')

    im.set_clim(vmin, vmax) 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:25,代碼來源:pyplot.py

示例6: imshow

# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import imshow [as 別名]
def imshow(
        X, cmap=None, norm=None, aspect=None, interpolation=None,
        alpha=None, vmin=None, vmax=None, origin=None, extent=None,
        shape=None, filternorm=1, filterrad=4.0, imlim=None,
        resample=None, url=None, *, data=None, **kwargs):
    __ret = gca().imshow(
        X, cmap=cmap, norm=norm, aspect=aspect,
        interpolation=interpolation, alpha=alpha, vmin=vmin,
        vmax=vmax, origin=origin, extent=extent, shape=shape,
        filternorm=filternorm, filterrad=filterrad, imlim=imlim,
        resample=resample, url=url, **({"data": data} if data is not
        None else {}), **kwargs)
    sci(__ret)
    return __ret


# Autogenerated by boilerplate.py.  Do not edit as changes will be lost. 
開發者ID:holzschu,項目名稱:python3_ios,代碼行數:19,代碼來源:pyplot.py

示例7: clim

# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import imshow [as 別名]
def clim(vmin=None, vmax=None):
    """
    Set the color limits of the current image.

    If either *vmin* or *vmax* is None, the image min/max respectively
    will be used for color scaling.

    If you want to set the clim of multiple images, use
    `~.ScalarMappable.set_clim` on every image, for example::

      for im in gca().get_images():
          im.set_clim(0, 0.5)

    """
    im = gci()
    if im is None:
        raise RuntimeError('You must first define an image, e.g., with imshow')

    im.set_clim(vmin, vmax) 
開發者ID:boris-kz,項目名稱:CogAlg,代碼行數:21,代碼來源:pyplot.py

示例8: imshow

# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import imshow [as 別名]
def imshow(
        X, cmap=None, norm=None, aspect=None, interpolation=None,
        alpha=None, vmin=None, vmax=None, origin=None, extent=None,
        shape=cbook.deprecation._deprecated_parameter, filternorm=1,
        filterrad=4.0, imlim=cbook.deprecation._deprecated_parameter,
        resample=None, url=None, *, data=None, **kwargs):
    __ret = gca().imshow(
        X, cmap=cmap, norm=norm, aspect=aspect,
        interpolation=interpolation, alpha=alpha, vmin=vmin,
        vmax=vmax, origin=origin, extent=extent, shape=shape,
        filternorm=filternorm, filterrad=filterrad, imlim=imlim,
        resample=resample, url=url, **({"data": data} if data is not
        None else {}), **kwargs)
    sci(__ret)
    return __ret


# Autogenerated by boilerplate.py.  Do not edit as changes will be lost. 
開發者ID:boris-kz,項目名稱:CogAlg,代碼行數:20,代碼來源:pyplot.py

示例9: gci

# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import imshow [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.
    """
    return gcf()._gci() 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:17,代碼來源:pyplot.py

示例10: colorbar

# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import imshow [as 別名]
def colorbar(mappable=None, cax=None, ax=None, **kw):
    if mappable is None:
        mappable = gci()
        if mappable is None:
            raise RuntimeError('No mappable was found to use for colorbar '
                               'creation. First define a mappable such as '
                               'an image (with imshow) or a contour set ('
                               'with contourf).')
    if ax is None:
        ax = gca()

    ret = gcf().colorbar(mappable, cax = cax, ax=ax, **kw)
    draw_if_interactive()
    return ret 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:16,代碼來源:pyplot.py

示例11: matshow

# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import imshow [as 別名]
def matshow(A, fignum=None, **kw):
    """
    Display an array as a matrix in a new figure window.

    The origin is set at the upper left hand corner and rows (first
    dimension of the array) are displayed horizontally.  The aspect
    ratio of the figure window is that of the array, unless this would
    make an excessively short or narrow figure.

    Tick labels for the xaxis are placed on top.

    With the exception of *fignum*, keyword arguments are passed to
    :func:`~matplotlib.pyplot.imshow`.  You may set the *origin*
    kwarg to "lower" if you want the first row in the array to be
    at the bottom instead of the top.


    *fignum*: [ None | integer | False ]
      By default, :func:`matshow` creates a new figure window with
      automatic numbering.  If *fignum* is given as an integer, the
      created figure will use this figure number.  Because of how
      :func:`matshow` tries to set the figure aspect ratio to be the
      one of the array, if you provide the number of an already
      existing figure, strange things may happen.

      If *fignum* is *False* or 0, a new figure window will **NOT** be created.
    """
    A = np.asanyarray(A)
    if fignum is False or fignum is 0:
        ax = gca()
    else:
        # Extract actual aspect ratio of array and make appropriately sized figure
        fig = figure(fignum, figsize=figaspect(A))
        ax  = fig.add_axes([0.15, 0.09, 0.775, 0.775])

    im = ax.matshow(A, **kw)
    sci(im)

    draw_if_interactive()
    return im 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:42,代碼來源:pyplot.py

示例12: colorbar

# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import imshow [as 別名]
def colorbar(mappable=None, cax=None, ax=None, **kw):
    if mappable is None:
        mappable = gci()
        if mappable is None:
            raise RuntimeError('No mappable was found to use for colorbar '
                               'creation. First define a mappable such as '
                               'an image (with imshow) or a contour set ('
                               'with contourf).')
    if ax is None:
        ax = gca()

    ret = gcf().colorbar(mappable, cax = cax, ax=ax, **kw)
    return ret 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:15,代碼來源:pyplot.py

示例13: imshow

# 需要導入模塊: from matplotlib.axes import Axes [as 別名]
# 或者: from matplotlib.axes.Axes import imshow [as 別名]
def imshow(
        X, cmap=None, norm=None, aspect=None, interpolation=None,
        alpha=None, vmin=None, vmax=None, origin=None, extent=None,
        shape=None, filternorm=1, filterrad=4.0, imlim=None,
        resample=None, url=None, *, data=None, **kwargs):
    __ret = gca().imshow(
        X=X, cmap=cmap, norm=norm, aspect=aspect,
        interpolation=interpolation, alpha=alpha, vmin=vmin,
        vmax=vmax, origin=origin, extent=extent, shape=shape,
        filternorm=filternorm, filterrad=filterrad, imlim=imlim,
        resample=resample, url=url, data=data, **kwargs)
    sci(__ret)
    return __ret

# Autogenerated by boilerplate.py.  Do not edit as changes will be lost. 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:17,代碼來源:pyplot.py


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