Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ccb51e0

Browse files
committed
DOC: add warning note to imsave
closes #3657
1 parent c8b9eb4 commit ccb51e0

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)