-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Doc: Fix Patheditor example #11431
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
Doc: Fix Patheditor example #11431
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't manage to trigger any error with the example as it is right now, and removing the blit line makes the example not work anymore on tkagg for me.
Anyone can dismiss the review if this problem is sorted out.
Ok, seems this needs some more detailed bug report. With Qt5Agg backend, py 3.6 on windows 8.1, running the example as script produces This error (hidden for convenience)
...this is hidden, collapsable content... With TkAgg backend, py 3.6 on windows 8.1, running the example as script runs fine without error and produces the desired plot. Removing the line This led me to the conclusion that, similarly to the poly_editor example, one should not try to blit inside the @anntzer What kind of error do you get when running this with the line in question removed? Does the same happen for the poly_editor example as it is now? |
This is the race condition that just keeps giving.... |
For me (linux/py3/tkagg), removing the line causes nothing to happen at all when attempting to drag a point. |
Any conclusion? Should I better close this and open an issue about it? |
I think leaving this open is just as good as opening a separate issue. |
Just marking as "Needs revision" so folks don't click on this as a PR that needs review, not as a spur to action.... |
Keeping this as an unfinished/dead PR will probably rather cause confusion once someone revisists this in the future. So, I guess I will open an issue about it one of those days. It's currently not clear (to me) why there is even a difference between the examples being run on windows and linux and this might well point towards a bigger underlying problem. |
I cannot reproduce any error with Qt5Agg using current |
I cannot reproduce the error either with:
@ImportanceOfBeingErnest can you test on a more recent version yourself? Otherwise I propose to close this assuming fixed tue to @QuLogic and me not being able to reproduce it. |
The issue is still present. matplotlib/examples/event_handling/poly_editor.py Lines 88 to 90 in 2d4fcc7
|
No wait. This is actually fixed by #16028 |
Actually in my hands the path_editor example now also works on tkagg without the blit; if others can confirm that perhaps we can just remove it. |
I was just playing with the path_editor example and found that with QtAgg if I resize the window I get
Removing the blit line fixes this for me. TkAgg works fine whether the blit line is there or not. I am on Ubuntu 22.04 and tested this with I was going to open a new issue but then found this. Maybe I should still open a new issue... |
PR Summary
The path editor example errors when being run with an interactive backend, due to a recursion in drawing the elements.
This PR fixes this issue by not blitting inside the draw_event (because that happens before the screen update anyways).