Skip to content

Clarify array shape vs image size in imshow() docstring #11125

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

Closed
wants to merge 1 commit into from
Closed
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: 5 additions & 5 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5027,7 +5027,7 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,

Parameters
----------
X : array_like, shape (n, m) or (n, m, 3) or (n, m, 4)
X : array_like, shape (M, N) or (M, N, 3) or (M, N, 4)
Display the image in `X` to current axes. `X` may be an
array or a PIL image. If `X` is an array, it
can have the following shapes and types:
Expand All @@ -5040,10 +5040,10 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
scalar to scalar) and the `cmap` (mapping the normed scalar to
a color).

Elements of RGB and RGBA arrays represent pixels of an MxN image.
All values should be in the range [0 .. 1] for floats or
[0 .. 255] for integers. Out-of-range values will be clipped to
these bounds.
Elements of RGB and RGBA arrays represent pixels of an NxM
(width x height) image. All values should be in the range
[0 .. 1] for floats or [0 .. 255] for integers. Out-of-range
values will be clipped to these bounds.

cmap : `~matplotlib.colors.Colormap`, optional, default: None
If None, default to rc `image.cmap` value. `cmap` is ignored
Expand Down