DOC: remove examples of subplot(123) from docs#17335
DOC: remove examples of subplot(123) from docs#17335jklymak wants to merge 7 commits intomatplotlib:masterfrom
Conversation
|
|
||
| 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.
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.
Agreed. Well, I kept a couple of the really recent ones...
|
|
||
| # 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.
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.
|
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, 3in the docs and code base.Sorry, I dislike these thrashy PRs as well, but feel we should really soft-deprecate this usage...
PR Checklist