Save an array as in image file.
The output formats available depend on the backend being used.
- Arguments:
- fname:
- A string containing a path 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:
- An MxN (luminance), MxNx3 (RGB) or MxNx4 (RGBA) array.
- Keyword arguments:
- 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:
- cmap is a colors.Colormap instance, e.g., cm.jet.
If None, default to the rc image.cmap value.
- format:
- One of the file extensions supported by the active
backend. Most backends support png, pdf, ps, eps and svg.
- origin
- [ ‘upper’ | ‘lower’ ] Indicates where the [0,0] index of
the array is in the upper left or lower left corner of
the axes. Defaults to the rc image.origin value.
- dpi
- The DPI to store in the metadata of the file. This does not affect the
resolution of the output image.