You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Doc]: subplot behavior is not same as the doc reads in 3.10(stable) #29447
In the given doc 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 removed
plt.subplot(211)
I tried to run the code in colab. It turns out that subplot doesn't remove previous plotting any more.
Suggested improvement
I recall the subplot 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.
This behaviour was deprecated in #22418 and removed in #25456. The note should definitely be removed from the docs now. If you are interested, feel free to open a PR removing it if we haven't done so soon.
Activity
QuLogic commentedon Jan 10, 2025
This behaviour was deprecated in #22418 and removed in #25456. The note should definitely be removed from the docs now. If you are interested, feel free to open a PR removing it if we haven't done so soon.
Khushikela29 commentedon Jan 11, 2025
I came across this issue and would love to contribute to it. Could you please let me know if it's available for me to work on?
Khushikela29 commentedon Jan 15, 2025
I've opened PR, can you please review it. I am open to all of your valuable suggestions :)