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 e6a9e25

Browse filesBrowse files
Khushikela29meeseeksmachine
authored andcommitted
Backport PR matplotlib#29471: Fix subplot docs
1 parent 5d2d694 commit e6a9e25
Copy full SHA for e6a9e25

File tree

Expand file treeCollapse file tree

2 files changed

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

2 files changed

+5
-10
lines changed

‎doc/api/axes_api.rst

Copy file name to clipboardExpand all lines: doc/api/axes_api.rst
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,5 +616,6 @@ Other
616616
Axes.get_transformed_clip_path_and_affine
617617
Axes.has_data
618618
Axes.set
619+
Axes.remove
619620

620621
.. autoclass:: matplotlib.axes.Axes.ArtistList

‎lib/matplotlib/pyplot.py

Copy file name to clipboardExpand all lines: lib/matplotlib/pyplot.py
+4-10Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,16 +1449,10 @@ def subplot(*args, **kwargs) -> Axes:
14491449
14501450
Notes
14511451
-----
1452-
Creating a new Axes will delete any preexisting Axes that
1453-
overlaps with it beyond sharing a boundary::
1454-
1455-
import matplotlib.pyplot as plt
1456-
# plot a line, implicitly creating a subplot(111)
1457-
plt.plot([1, 2, 3])
1458-
# now create a subplot which represents the top plot of a grid
1459-
# with 2 rows and 1 column. Since this subplot will overlap the
1460-
# first, the plot (and its Axes) previously created, will be removed
1461-
plt.subplot(211)
1452+
.. versionchanged:: 3.8
1453+
In versions prior to 3.8, any preexisting Axes that overlap with the new Axes
1454+
beyond sharing a boundary was deleted. Deletion does not happen in more
1455+
recent versions anymore. Use `.Axes.remove` explicitly if needed.
14621456
14631457
If you do not want this behavior, use the `.Figure.add_subplot` method
14641458
or the `.pyplot.axes` function instead.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.