Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 50fd61a

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

File tree

Expand file treeCollapse file tree

1 file changed

+7
-10
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-10
lines changed

‎lib/matplotlib/pyplot.py

Copy file name to clipboardExpand all lines: lib/matplotlib/pyplot.py
+7-10Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.