Skip to content

Commit 7c458af

Browse files
authored
Merge pull request #15531 from meeseeksmachine/auto-backport-of-pr-15527-on-v3.2.x
Backport PR #15527 on branch v3.2.x (Clarify imshow() docs concerning scaling and grayscale images)
2 parents f344400 + 78e6fe1 commit 7c458af

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5425,15 +5425,21 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
54255425
origin=None, extent=None, shape=None, filternorm=1,
54265426
filterrad=4.0, imlim=None, resample=None, url=None, **kwargs):
54275427
"""
5428-
Display an image, i.e. data on a 2D regular raster.
5428+
Display data as an image; i.e. on a 2D regular raster.
5429+
5430+
The input may either be actual RGB(A) data, or 2D scalar data, which
5431+
will be rendered as a pseudocolor image. Note: For actually displaying
5432+
a grayscale image set up the color mapping using the parameters
5433+
``cmap='gray', vmin=0, vmax=255``.
54295434
54305435
Parameters
54315436
----------
54325437
X : array-like or PIL image
54335438
The image data. Supported array shapes are:
54345439
5435-
- (M, N): an image with scalar data. The data is visualized
5436-
using a colormap.
5440+
- (M, N): an image with scalar data. The values are mapped to
5441+
colors using normalization and a colormap. See parameters *norm*,
5442+
*cmap*, *vmin*, *vmax*.
54375443
- (M, N, 3): an image with RGB values (0-1 float or 0-255 int).
54385444
- (M, N, 4): an image with RGBA values (0-1 float or 0-255 int),
54395445
i.e. including transparency.

0 commit comments

Comments
 (0)