@@ -2148,7 +2148,7 @@ def imsave(fname, arr, **kwargs):
2148
2148
return matplotlib .image .imsave (fname , arr , ** kwargs )
2149
2149
2150
2150
2151
- def matshow (A , fignum = None , ** kw ):
2151
+ def matshow (A , fignum = None , ** kwargs ):
2152
2152
"""
2153
2153
Display an array as a matrix in a new figure window.
2154
2154
@@ -2159,21 +2159,34 @@ def matshow(A, fignum=None, **kw):
2159
2159
2160
2160
Tick labels for the xaxis are placed on top.
2161
2161
2162
- With the exception of *fignum*, keyword arguments are passed to
2163
- :func:`~matplotlib.pyplot.imshow`. You may set the *origin*
2164
- kwarg to "lower" if you want the first row in the array to be
2165
- at the bottom instead of the top.
2162
+ Parameters
2163
+ ----------
2164
+ A : array-like(M, N)
2165
+ The matrix to be displayed.
2166
+
2167
+ fignum : None or int or False
2168
+ If *None*, create a new figure window with automatic numbering.
2169
+
2170
+ If *fignum* is an integer, draw into the figure with the given number
2171
+ (create it if it does not exist).
2172
+
2173
+ If 0 or *False*, use the current axes if it exists instead of creating
2174
+ a new figure.
2175
+
2176
+ .. note::
2166
2177
2178
+ Because of how `.Axes.matshow` tries to set the figure aspect
2179
+ ratio to be the one of the array, strange things may happen if you
2180
+ reuse an existing figure.
2167
2181
2168
- *fignum*: [ None | integer | False ]
2169
- By default, :func:`matshow` creates a new figure window with
2170
- automatic numbering. If *fignum* is given as an integer, the
2171
- created figure will use this figure number. Because of how
2172
- :func:`matshow` tries to set the figure aspect ratio to be the
2173
- one of the array, if you provide the number of an already
2174
- existing figure, strange things may happen.
2182
+ Returns
2183
+ -------
2184
+ image : `~matplotlib.image.AxesImage`
2185
+
2186
+ Other Parameters
2187
+ ----------------
2188
+ **kwargs : `~matplotlib.axes.Axes.imshow` arguments
2175
2189
2176
- If *fignum* is *False* or 0, a new figure window will **NOT** be created.
2177
2190
"""
2178
2191
A = np .asanyarray (A )
2179
2192
if fignum is False or fignum is 0 :
@@ -2183,7 +2196,7 @@ def matshow(A, fignum=None, **kw):
2183
2196
fig = figure (fignum , figsize = figaspect (A ))
2184
2197
ax = fig .add_axes ([0.15 , 0.09 , 0.775 , 0.775 ])
2185
2198
2186
- im = ax .matshow (A , ** kw )
2199
+ im = ax .matshow (A , ** kwargs )
2187
2200
sci (im )
2188
2201
2189
2202
return im
0 commit comments