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