8000 DOC: Improve pyplot.matshow · matplotlib/matplotlib@4ecc2a4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4ecc2a4

Browse files
Impaler343timhoffm
authored andcommitted
DOC: Improve pyplot.matshow
1 parent 787f308 commit 4ecc2a4

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

lib/matplotlib/pyplot.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2433,12 +2433,20 @@ def imsave(
24332433

24342434
def matshow(A: ArrayLike, fignum: None | int = None, **kwargs) -> AxesImage:
24352435
"""
2436-
Display an array as a matrix in a new figure window.
2436+
Display a 2D array as a matrix in a new figure window.
24372437
2438-
The origin is set at the upper left hand corner and rows (first
2439-
dimension of the array) are displayed horizontally. The aspect
2440-
ratio of the figure window is that of the array, unless this would
2441-
make an excessively short or narrow figure.
2438+
The origin is set at the upper left hand corner.
2439+
The indexing is ``(row, column)`` so that the first index runs vertically
2440+
and the second index runs horizontally in the figure:
2441+
2442+
.. code-block:: none
2443+
2444+
A[0, 0] ⋯ A[0, M-1]
2445+
⋮ ⋮
2446+
A[N-1, 0] ⋯ A[N-1, M-1]
2447+
2448+
The aspect ratio 4D9C of the figure window is that of the array,
2449+
unless this would make an excessively short or narrow figure.
24422450
24432451
Tick labels for the xaxis are placed on top.
24442452

0 commit comments

Comments
 (0)
0