8000 [Doc]: `subplot` behavior is not same as the doc reads in 3.10(stable) · Issue #29447 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

[Doc]: subplot behavior is not same as the doc reads in 3.10(stable) #29447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mocheng opened this issue Jan 10, 2025 · 3 comments · Fixed by #29471
Closed

[Doc]: subplot behavior is not same as the doc reads in 3.10(stable) #29447

mocheng opened this issue Jan 10, 2025 · 3 comments · Fixed by #29471
Milestone

Comments

@mocheng
Copy link
mocheng commented Jan 10, 2025

Documentation Link

https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.subplot.html

Problem

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.

image

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.

@QuLogic QuLogic added this to the v3.10.0-doc milestone Jan 10, 2025
@QuLogic
Copy link
Member
QuLogic commented 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
Copy link
Contributor

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 Khushikela29 mentioned this issue Jan 14, 2025
2 tasks
@Khushikela29
Copy link
Contributor

I've opened PR, can you please review it. I am open to all of your valuable suggestions :)

@rcomer rcomer modified the milestones: v3.10.0-doc, v3.10.1 Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
0