-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC: remove examples of subplot(123) from docs #17335
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
@@ -92,7 +92,7 @@ Axes creation | |||
use:: | |||
|
|||
f = Figure(figsize=(5,4), dpi=100) | |||
a = f.add_subplot(111) | |||
a = f.add_subplot(1, 1, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I strongly think we should not change old API changes notes -- they should stay representative of what the lib was back when that release occured.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Well, I kept a couple of the really recent ones...
doc/devel/documenting_mpl.rst
Outdated
@@ -820,7 +820,7 @@ example is generated from | |||
s = 1 + np.sin(2 * np.pi * t) | |||
|
|||
# Note that using plt.subplots below is equivalent to using | |||
# fig = plt.figure and then ax = fig.add_subplot(111) | |||
# fig = plt.figure and then ax = fig.add_subplot(1, 1, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that add_subplot(111)
can be spelt even more succintly as add_subplot()
now (it defaults to 111). Especially when you're clearly not going to have a single subplot, I think the argless version is actually the cleanest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed.
Semi-OT: IMHO |
@timhoffm I agree, but thats a far bigger job. And the Conversely |
Anybody using BTW, we could add |
Nice idea - `subplot(4, 4, (0, 3))`
I suppose you could just forbid `subplot(44, (0, 3))`, and then 0-based
indexing would make more sense.
|
|
And when you think you know all the miraculous ways you can create an Axes, there‘s always one more API ... 😩. I‘m really not sure we should change any of these API anymore unless we have a greater plan which and how these should be used (and maybe soft-deprecate some). This is only referring to |
Well, we already have |
I would be happy to see the 3-digit form go--but we're still stuck with it in the |
I don't see any reasons not to merge this, but it's grown a bunch of conflicts now. |
👍 on the PR. It's proably easier to redo this from scratch using regex serach&replace than handling all the conflicts. |
I only relearn regexp every 6 months or so, so this may have to wait, or anyone else is welcome to take this up instead! |
Most cases have been addressed via the above PRs. Still open: More complex layouts that are not full single-cell grids. These can be handled using |
I'll go ahead and close this, but feel free to restore if you need it to track the issue... |
PR Summary
Changes all
*subplot(123,
tosubplot(1, 2, 3
in the docs and code base.Sorry, I dislike these thrashy PRs as well, but feel we should really soft-deprecate this usage...
PR Checklist