@@ -2378,7 +2378,7 @@ def imsave(*args, **kwargs):
2378
2378
return _imsave (* args , ** kwargs )
2379
2379
2380
2380
2381
- def matshow (A , fignum = None , ** kw ):
2381
+ def matshow (A , fignum = None , ** kwargs ):
2382
2382
"""
2383
2383
Display an array as a matrix in a new figure window.
2384
2384
@@ -2389,21 +2389,34 @@ def matshow(A, fignum=None, **kw):
2389
2389
2390
2390
Tick labels for the xaxis are placed on top.
2391
2391
2392
- With the exception of *fignum*, keyword arguments are passed to
2393
- :func:`~matplotlib.pyplot.imshow`. You may set the *origin*
2394
- kwarg to "lower" if you want the first row in the array to be
2395
- at the bottom instead of the top.
2392
+ Parameters
2393
+ ----------
2394
+ A : array-like(M, N)
2395
+ The matrix to be displayed.
2396
+
2397
+ fignum : None or int or False
2398
+ If *None*, create a new figure window with automatic numbering.
2399
+
2400
+ If *fignum* is an integer, draw into the figure with the given number
2401
+ (create it if it does not exist).
2402
+
2403
+ If 0 or *False*, use the current axes if it exists instead of creating
2404
+ a new figure.
2405
+
2406
+ .. note::
2396
2407
2408
+ Because of how `.Axes.matshow` tries to set the figure aspect
2409
+ ratio to be the one of the array, strange things may happen if you
2410
+ reuse an existing figure.
2397
2411
2398
- *fignum*: [ None | integer | False ]
2399
- By default, :func:`matshow` creates a new figure window with
2400
- automatic numbering. If *fignum* is given as an integer, the
2401
- created figure will use this figure number. Because of how
2402
- :func:`matshow` tries to set the figure aspect ratio to be the
2403
- one of the array, if you provide the number of an already
2404
- existing figure, strange things may happen.
2412
+ Returns
2413
+ -------
2414
+ image : `~matplotlib.image.AxesImage`
2415
+
2416
+ Other Parameters
2417
+ ----------------
2418
+ **kwargs : `~matplotlib.axes.Axes.imshow` arguments
2405
2419
2406
- If *fignum* is *False* or 0, a new figure window will **NOT** be created.
2407
2420
"""
2408
2421
A = np .asanyarray (A )
2409
2422
if fignum is False or fignum is 0 :
@@ -2413,7 +2426,7 @@ def matshow(A, fignum=None, **kw):
2413
2426
fig = figure (fignum , figsize = figaspect (A ))
2414
2427
ax = fig .add_axes ([0.15 , 0.09 , 0.775 , 0.775 ])
2415
2428
2416
- im = ax .matshow (A , ** kw )
2429
+ im = ax .matshow (A , ** kwargs )
2417
2430
sci (im )
2418
2431
2419
2432
return im
0 commit comments