Closed
Description
At creation time each manager is assigned a number (which is either 1 or 1 higher than the currently existing number) and there is some API in pyplot to get the list of current numbers etc. Currently in mpl-gui, this number is set in the promote_figure
method and is a process-globally incremented number. I think the options are:
- no change, the number of the manager is a vestige of an old API, it is harmless, but 🤷🏻 . Using an always incrementing counter means that we never have currently-live duplicates (because we never have duplicates)
- allow
promote_figure
to take an optional num as input (but probably still increment the counter for cases where it is not given. We can then have the registries re-implement the pyplot scheme. One wrinkle in this is if you ask for the number before all of the figures are promoted, they do not have numbers yet so either we need to pre-assign them numbers (not great, where to store that), drop them on the floor (not great, the list of figures can depend on if you called show?!), or promote but not show (probably the least-bad). - make
num
required to promote - add the notion of num to creating
Figure
objects.
Having written this out i'm going to go with option 2. It is not too hard to let registries maintain the old pyplot behavior and I would rather have all registries behave the same than have a custom one just for getting as close to pyplot compatibility as possible.
Metadata
Metadata
Assignees
Labels
No labels