Skip to content

Commit 50fd61a

Browse files
tacaswellmeeseeksmachine
authored andcommitted
Backport PR matplotlib#27244: Clarify semantics of plt.matshow(..., fignum=...).
1 parent 02aa131 commit 50fd61a

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

lib/matplotlib/pyplot.py

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

0 commit comments

Comments
 (0)