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

Skip to content

Commit 9443e6e

Browse files
jklymakMeeseeksDev[bot]
authored and
MeeseeksDev[bot]
committed
Backport PR #10991: Improve docstring of Axes.matshow
1 parent f4cdc0b commit 9443e6e

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7693,14 +7693,14 @@ def spy(self, Z, precision=0, marker=None, markersize=None,
76937693

76947694
def matshow(self, Z, **kwargs):
76957695
"""
7696-
Plot a matrix or array as an image.
7696+
Plot the values of a 2D matrix or array as color-coded image.
76977697
76987698
The matrix will be shown the way it would be printed, with the first
76997699
row at the top. Row and column numbering is zero-based.
77007700
77017701
Parameters
77027702
----------
7703-
Z : array_like shape (n, m)
7703+
Z : array-like(N, M)
77047704
The matrix to be displayed.
77057705
77067706
Returns
@@ -7710,12 +7710,21 @@ def matshow(self, Z, **kwargs):
77107710
Other Parameters
77117711
----------------
77127712
**kwargs : `~matplotlib.axes.Axes.imshow` arguments
7713-
Sets `origin` to 'upper', 'interpolation' to 'nearest' and
7714-
'aspect' to equal.
77157713
7716-
See also
7714+
See Also
77177715
--------
7718-
imshow : plot an image
7716+
imshow : More general function to plot data on a 2D regular raster.
7717+
7718+
Notes
7719+
-----
7720+
This is just a convenience function wrapping `.imshow` to set useful
7721+
defaults for a displaying a matrix. In particular:
7722+
7723+
- Set ``origin='upper'``.
7724+
- Set ``interpolation='nearest'``.
7725+
- Set ``aspect='equal'``.
7726+
- Ticks are placed to the left and above.
7727+
- Ticks are formatted to show integer indices.
77197728
77207729
"""
77217730
Z = np.asanyarray(Z)

0 commit comments

Comments
 (0)