Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Labels
Milestone
Description
Documentation Link
https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.subplot.html
Problem
In the givendoc link for version 3.10(stable), it reads
Creating a new Axes will delete any preexisting Axes that overlaps with it beyond sharing a boundary:
The code is as below
import matplotlib.pyplot as plt# plot a line, implicitly creating a subplot(111)plt.plot([1, 2, 3])# now create a subplot which represents the top plot of a grid# with 2 rows and 1 column. Since this subplot will overlap the# first, the plot (and its Axes) previously created, will be removedplt.subplot(211)
I tried to run the code in colab. It turns out thatsubplot
doesn't remove previous plotting any more.

Suggested improvement
I recall thesubplot
behavior does remove previous plotting. Perhaps some code change alter the behavior. The current behavior is good.
I suppose the doc should be updated to match the actual behavior.