Skip to content

Commit 09c7b7b

Browse files
authored
Merge pull request matplotlib#27244 from anntzer/pm
Clarify semantics of plt.matshow(..., fignum=...).
2 parents f05167c + d2569a3 commit 09c7b7b

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

lib/matplotlib/pyplot.py

+7-10
Original file line numberDiff line numberDiff line change
@@ -2412,18 +2412,15 @@ def matshow(A: ArrayLike, fignum: None | int = None, **kwargs) -> AxesImage:
24122412
The matrix to be displayed.
24132413
24142414
fignum : None or int
2415-
If *None*, create a new figure window with automatic numbering.
2415+
If *None*, create a new, appropriately sized figure window.
24162416
2417-
If a nonzero integer, draw into the figure with the given number
2418-
(create it if it does not exist).
2417+
If 0, use the current Axes (creating one if there is none, without ever
2418+
adjusting the figure size).
24192419
2420-
If 0, use the current axes (or create one if it does not exist).
2421-
2422-
.. note::
2423-
2424-
Because of how `.Axes.matshow` tries to set the figure aspect
2425-
ratio to be the one of the array, strange things may happen if you
2426-
reuse an existing figure.
2420+
Otherwise, create a new Axes on the figure with the given number
2421+
(creating it at the appropriate size if it does not exist, but not
2422+
adjusting the figure size otherwise). Note that this will be drawn on
2423+
top of any preexisting Axes on the figure.
24272424
24282425
Returns
24292426
-------

0 commit comments

Comments
 (0)