Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
ENH: use canvas renderer in draw#19765
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
91e97fa
to3f7d454
CompareI am 👎 on this. Every artist has a We already have |
What is the user-facing way to force a draw on a figure if not |
|
I think the interplay between a figure and its canvas is pretty obscure to most people, including me apparently. I still think a discoverable way to trigger a draw is preferable, but don't feel super strongly about it. |
Actually I'll re-open. We do need to tell users to trigger draws, and having to send them to something that is undocumented is not great. I think that trumps aesthetics as to whether figure is a special artist or not. As for other artists, I'd be fine if we wanted them to get their canvas and use that as a default in all these routines... |
timhoffm commentedMar 27, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Without having looked into the details and without claiming to understand the internal mechanics: |
I believe that a problem is that |
Hmm, we have What I am suggesting here is to change I agree this is all confusing, but my confusion is that I don't understand all the other needs to call |
timhoffm commentedMar 28, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There's (i) |
Thanks, that all sounds right. Unfortunately
and only the last I will still maintain that it is unintuitive that just to get the proper position of elements on the canvas we have to reach down and force a draw on the canvas |
Mid-script you have not given the Qt event loop a chance to run (seehttps://matplotlib.org/stable/users/interactive_guide.html#scripts-and-functions).
yes. To make matters worse there is also I agree it is confusing that almost everything is named In 3.4 we made sure that I think what we should do instead is to promote matplotlib/lib/matplotlib/backend_bases.py Lines 1587 to 1590 inc81f58d
mpl.make_internal_state_consistent(fig) orfig.resolve_deferred_computations ? |
I think that would be great plus or minus the name. |
Fig.no_output_draw doesn't seem so bad to me, or draw_no_output. |
pharshalp commentedMar 28, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
As a frequent user of constrained_layout, I have been saving figures to a withio.BytesIO()astemp_io_buffer:fig.savefig(temp_io_buffer) so replacing all that with a |
So I think the consensus here is:
"no_output_draw" is a bit miss leading because the "output" of What I think the name needs to communicate that this:
|
I'm just a simple fellow, with minimal knowledge of the backends, but that sounds a lot like drawing with "no output" to the screen or file system. I don't think "no output" conveys nothing happens. |
Replaced by#19967 |
But that's also closed? |
Ooops,#19968 replaces that. I was trying a new GitHub workflow, and obviously didn't understand what it was doing! |
PR Summary
I'm not sure why we required the renderer to be passed to
fig.draw
, but suggest we allow it to be a kwarg and default tofig.canvas.get_renderer()
PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
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).