Skip to content

Commit 43e875b

Browse files
committed
doc:updates the docstring
1 parent 3fb9c09 commit 43e875b

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

lib/matplotlib/pyplot.py

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

0 commit comments

Comments
 (0)