@@ -1398,16 +1398,15 @@ def imread(fname, format=None):
13981398def imsave (fname , arr , vmin = None , vmax = None , cmap = None , format = None ,
13991399 origin = None , dpi = 100 ):
14001400 """
1401- Save an array as in image file.
1402-
1403- The output formats available depend on the backend being used.
1401+ Save an array as an image file.
14041402
14051403 Parameters
14061404 ----------
1407- fname : str or file-like
1408- The filename or a Python file-like object to store the image in.
1409- The necessary output format is inferred from the filename extension
1410- but may be explicitly overwritten using *format*.
1405+ fname : str or PathLike file-like
1406+ A path or a Python file-like object to store the image in.
1407+ If *format* is not set, then the output format is inferred from the
1408+ extension of *fname*, if any, and from :rc:`savefig.format` otherwise.
1409+ If *format* is set, it determines the output format.
14111410 arr : array-like
14121411 The image data. The shape can be one of
14131412 MxN (luminance), MxNx3 (RGB) or MxNx4 (RGBA).
@@ -1421,9 +1420,8 @@ def imsave(fname, arr, vmin=None, vmax=None, cmap=None, format=None,
14211420 maps scalar data to colors. It is ignored for RGB(A) data.
14221421 Defaults to :rc:`image.cmap` ('viridis').
14231422 format : str, optional
1424- The file format, e.g. 'png', 'pdf', 'svg', ... . If not given, the
1425- format is deduced form the filename extension in *fname*.
1426- See `.Figure.savefig` for details.
1423+ The file format, e.g. 'png', 'pdf', 'svg', ... The behavior when this
1424+ is unset is documented under *fname*.
14271425 origin : {'upper', 'lower'}, optional
14281426 Indicates whether the ``(0, 0)`` index of the array is in the upper
14291427 left or lower left corner of the axes. Defaults to :rc:`image.origin`
0 commit comments