Skip to content

Commit 54d751b

Browse files
authored
Merge pull request #24320 from tacaswell/doc_imsave_warning
DOC: add warning note to imsave
2 parents ea98aec + ccb51e0 commit 54d751b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/matplotlib/image.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1547,7 +1547,15 @@ def imread(fname, format=None):
15471547
def imsave(fname, arr, vmin=None, vmax=None, cmap=None, format=None,
15481548
origin=None, dpi=100, *, metadata=None, pil_kwargs=None):
15491549
"""
1550-
Save an array as an image file.
1550+
Colormap and save an array as an image file.
1551+
1552+
RGB(A) images are passed through. Single channel images will be
1553+
colormapped according to *cmap* and *norm*.
1554+
1555+
.. note ::
1556+
1557+
If you want to save a single channel image as gray scale please use an
1558+
image I/O library (such as pillow, tifffile, or imageio) directly.
15511559
15521560
Parameters
15531561
----------

0 commit comments

Comments
 (0)