Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? RAG (Retrieval-Augmented Generation)
et Fine Tuning d'un LLM
Voir le programme détaillé
Module « matplotlib.pyplot »

Fonction imsave - module matplotlib.pyplot

Signature de la fonction imsave

def imsave(fname: 'str | os.PathLike | BinaryIO', arr: 'ArrayLike', **kwargs) -> 'None' 

Description

help(matplotlib.pyplot.imsave)

Colormap and save an array as an image file.

RGB(A) images are passed through.  Single channel images will be
colormapped according to *cmap* and *norm*.

.. note::

   If you want to save a single channel image as gray scale please use an
   image I/O library (such as pillow, tifffile, or imageio) directly.

Parameters
----------
fname : str or path-like or file-like
    A path or a file-like object to store the image in.
    If *format* is not set, then the output format is inferred from the
    extension of *fname*, if any, and from :rc:`savefig.format` otherwise.
    If *format* is set, it determines the output format.
arr : array-like
    The image data. The shape can be one of
    MxN (luminance), MxNx3 (RGB) or MxNx4 (RGBA).
vmin, vmax : float, optional
    *vmin* and *vmax* set the color scaling for the image by fixing the
    values that map to the colormap color limits. If either *vmin*
    or *vmax* is None, that limit is determined from the *arr*
    min/max value.
cmap : str or `~matplotlib.colors.Colormap`, default: :rc:`image.cmap`
    A Colormap instance or registered colormap name. The colormap
    maps scalar data to colors. It is ignored for RGB(A) data.
format : str, optional
    The file format, e.g. 'png', 'pdf', 'svg', ...  The behavior when this
    is unset is documented under *fname*.
origin : {'upper', 'lower'}, default: :rc:`image.origin`
    Indicates whether the ``(0, 0)`` index of the array is in the upper
    left or lower left corner of the Axes.
dpi : float
    The DPI to store in the metadata of the file.  This does not affect the
    resolution of the output image.  Depending on file format, this may be
    rounded to the nearest integer.
metadata : dict, optional
    Metadata in the image file.  The supported keys depend on the output
    format, see the documentation of the respective backends for more
    information.
    Currently only supported for "png", "pdf", "ps", "eps", and "svg".
pil_kwargs : dict, optional
    Keyword arguments passed to `PIL.Image.Image.save`.  If the 'pnginfo'
    key is present, it completely overrides *metadata*, including the
    default 'Software' key.

Notes
-----

.. note::

    This is equivalent to `matplotlib.image.imsave`.


Vous êtes un professionnel et vous avez besoin d'une formation ? RAG (Retrieval-Augmented Generation)
et Fine Tuning d'un LLM
Voir le programme détaillé