Skip to content

Backport PR #24320 on branch v3.6.x (DOC: add warning note to imsave) #24323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/matplotlib/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,15 @@ def imread(fname, format=None):
def imsave(fname, arr, vmin=None, vmax=None, cmap=None, format=None,
origin=None, dpi=100, *, metadata=None, pil_kwargs=None):
"""
Save an array as an image file.
Colormap and save an array as an image file.

RGB(A) images are passed through. Single channel images will be
colormapped according to *cmap* and *norm*.

.. note ::

If you want to save a single channel image as gray scale please use an
image I/O library (such as pillow, tifffile, or imageio) directly.

Parameters
----------
Expand Down