-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Deprecate add_subplot(<no positional args>) silently doing nothing. #13127
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
Conversation
b73a94a
to
f9029d6
Compare
Looks like it needs a test. |
Seems like a bit overkill right now; if we do make add_subplots() behave like add_subplots(111) then I'll add a test at that time... |
POLL: add_subplot() adds a plot... thumbs down if it should error... |
The |
Do we even want a deprecation period here, or should we just switch directly to adding the 111 plot? |
What is the use-case story for someone intentionally passing nothing into |
The same question applies to many other changes I've proposed over the years, but I've learnt better... |
This code appears to go back to 18dca66 .
@anntzer I do feel your frustration, but telling apart "there is no use case, it is like this by coincidence" from "this is critical to a use-case that I am not familiar with" from "this used to be part of an important use-case that no longer exists" is subtle (because it involves proving a negative and / or knowing what you don't know). |
@jklymak why the needs-revision tag? Did we decide to just skip the deprecation? |
Yeah I think so, right? As in no one could think of a case where the do nothing behaviour would be desirable. |
I guess add_axes should also be checked out as well? |
I don't think there's a sane default rectangle for add_axes? |
To avoid head-scratching when `add_subplot(projection="3d")` does nothing (the correct call is `add_subplot(111, projection="3d")`).
f9029d6
to
9eb7f87
Compare
Changed the behavior of add_subplot as suggested. |
I'm going to merge on the basis of the polls above, despite the fact @dstansby's approval somewhat predated those changes. |
To avoid head-scratching when
add_subplot(projection="3d")
doesnothing (the correct call is
add_subplot(111, projection="3d")
).Also a poll: after the deprecation period, should
add_subplot(<no positional args>)
add_subplot(111, **kwargs)
(see the mplot3d case above for a reasonable use case)?PR Summary
PR Checklist