matplotlib.pyplot.imsave
-
matplotlib.pyplot.imsave(*args, **kwargs)
-
Save an array as in image file.
The output formats available depend on the backend being used.
Parameters: fname : str or file-like
Path string to a filename, or a Python file-like object. If format is None and fname is a string, the output format is deduced from the extension of the filename.
arr : array-like
An MxN (luminance), MxNx3 (RGB) or MxNx4 (RGBA) array.
vmin, vmax: [ None | scalar ]
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 : matplotlib.colors.Colormap, optional
For example,
cm.viridis
. IfNone
, defaults to theimage.cmap
rcParam.format : str
One of the file extensions supported by the active backend. Most backends support png, pdf, ps, eps and svg.
origin : [ ‘upper’ | ‘lower’ ]
Indicates whether the
(0, 0)
index of the array is in the upper left or lower left corner of the axes. Defaults to theimage.origin
rcParam.dpi : int
The DPI to store in the metadata of the file. This does not affect the resolution of the output image.
© 2012–2017 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
http://matplotlib.org/2.1.0/api/_as_gen/matplotlib.pyplot.imsave.html