Skip to content

Commit ea96879

Browse files
authored
Merge pull request #24323 from meeseeksmachine/auto-backport-of-pr-24320-on-v3.6.x
Backport PR #24320 on branch v3.6.x (DOC: add warning note to imsave)
2 parents 28fb5d1 + c2fb20a commit ea96879

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/matplotlib/image.py

+9-1
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)