I think there should be a standalone pyplot only gallery page, but think for this PR a potential resolution would be to sort the OO examples into the correct sections (possibly combining them with existing content) or altogether remove them if they're not adding any information.
xref: #15355 because I think this contributes to some of the confusion discussed there.
What we can do right now
In the short term, it would really help to better document the similarities and differences between pyplot and OO style. The current docs are not quite instructive on that; and no matter what we could add immediately what we plan to do in the long term, these are public APIs and will therefore be around for a long time.
Additional thoughts
It may even be a good idea to have a complete separation on the API level, in the sense that there should be non-pyplot helper functions for figure/subplot creation (It might be that we still use the same figure management under the hood). That way, one can have two completely separate APIs. Emphasizing this may help to reduce confusion.
My thought to this:
Is it possible to have the whole API default to the pyplot style, but every example has a button that switches the code example from pyplot to OO?
So that people can choose which code they want to see.
Thanks for the idea! Unfortunately, switching examples between pyplot and OO is not feasible IMHO.
The examples are created from pure python files using sphinx-gallery. The switching mechanism would have to be integrated into that framework.
We‘d need two versions of each example. IMHO auto-conversion is not feasible due to the hidden state in pyplot. Creating such a tool would either fail in more complicated cases or be extremely complicated to write. Given the large amount of examples, manually creating and maintaining multiple versions is also not an option.
Activity
kolibril13 commented on Jan 1, 2020
From #15938 timhoffm wrote:
My thought to this:
Is it possible to have the whole API default to the pyplot style, but every example has a button that switches the code example from pyplot to OO?
So that people can choose which code they want to see.
timhoffm commented on Jan 2, 2020
Thanks for the idea! Unfortunately, switching examples between pyplot and OO is not feasible IMHO.
jklymak commented on Sep 28, 2022
There is some arguing about what should stay or go, but actually fixing this is pretty easy, so marking good first issue
StefRe commented on Sep 28, 2022
As I'm the culprit of bringing up this topic again in #24023, here's my proposal: