-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Make figure parameter optional when constructing canvases. #18746
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
We are going to redudently create and discard a I am 👍 on this, but it needs atleast one test that exercises it! |
Initializing a FigureCanvasBase should be pretty cheap (it's mostly just setting a bunch of attributes, the most complex likely being creating the CallbackRegistry but as you know I'm trying to move that to the Figure instance anyways). |
linter needs to pass... |
should be better now... |
Seems like you didn't rebase on latest master? Docs should be fixed by now. |
Auto-instantiating a Figure seems reasonable enough, and helps with GUI builders. (The auto-instantiated figure must be a plain Figure(), not a a pyplot-registered figure, both because most likely one should not use pyplot when building GUIs, and also more prosaically because that would run into a circular dependency (pyplot needs a canvas already instantiated (actually a manager that holds a canvas) to store into its global registry).
retry. |
Auto-instantiating a Figure seems reasonable enough, and helps with GUI
builders. (The auto-instantiated figure must be a plain Figure(), not
a a pyplot-registered figure, both because most likely one should not
use pyplot when building GUIs, and also more prosaically because that
would run into a circular dependency (pyplot needs a canvas already
instantiated (actually a manager that holds a canvas) to store into its
global registry).
Closes #17349.
PR Summary
PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
andpydocstyle<4
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).