Doc: Fix Patheditor example by ImportanceOfBeingErnest · Pull Request #11431 · matplotlib/matplotlib · GitHub
Skip to content

Doc: Fix Patheditor example - #11431

Closed
ImportanceOfBeingErnest wants to merge 1 commit into
matplotlib:masterfrom
ImportanceOfBeingErnest:fix-patheditor-example
Closed

Doc: Fix Patheditor example#11431
ImportanceOfBeingErnest wants to merge 1 commit into
matplotlib:masterfrom
ImportanceOfBeingErnest:fix-patheditor-example

Conversation

@ImportanceOfBeingErnest

Copy link
Copy Markdown
Member

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).

@anntzer anntzer left a comment

Copy link
Copy Markdown
Contributor

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.

@ImportanceOfBeingErnest

Copy link
Copy Markdown
Member Author

@tacaswell

Copy link
Copy Markdown
Member

This is the race condition that just keeps giving....

@tacaswell tacaswell added this to the v2.2.3 milestone Jun 13, 2018
@anntzer

anntzer commented Jun 13, 2018

Copy link
Copy Markdown
Contributor

For me (linux/py3/tkagg), removing the line causes nothing to happen at all when attempting to drag a point.

@ImportanceOfBeingErnest

ImportanceOfBeingErnest commented Jun 18, 2018

Copy link
Copy Markdown
Member Author

Any conclusion? Should I better close this and open an issue about it?
For sure the example that crashes on Windows should not stay in the docs, unless there is a way to make it work again. I wonder why the other example would still run on both systems while there does not seem to be that much of a difference.

@anntzer

anntzer commented Jun 18, 2018

Copy link
Copy Markdown
Contributor

I think leaving this open is just as good as opening a separate issue.

@jklymak

jklymak commented Jul 3, 2018

Copy link
Copy Markdown
Member

Just marking as "Needs revision" so folks don't click on this as a PR that needs review, not as a spur to action....

@ImportanceOfBeingErnest

Copy link
Copy Markdown
Member Author

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.

@QuLogic

QuLogic commented Apr 1, 2020

Copy link
Copy Markdown
Member

I cannot reproduce any error with Qt5Agg using current master.

@timhoffm

timhoffm commented May 3, 2020

Copy link
Copy Markdown
Member

I cannot reproduce the error either with:

  • Python 3.7.7
  • PyQt5 5.9.6
  • matplotlib 3.1.3

@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.

@ImportanceOfBeingErnest

Copy link
Copy Markdown
Member Author

The issue is still present.
Again let me mention that the same is applied to the poly_editor example which even has a comment on why:

self.ax.draw_artist(self.line)
# do not need to blit here, this will fire before the screen is
# updated

@ImportanceOfBeingErnest

Copy link
Copy Markdown
Member Author

No wait. This is actually fixed by #16028
Closing this.
Although I would actually be interested in knowing why the one example can live without a blit and the other not...

@ImportanceOfBeingErnest
ImportanceOfBeingErnest deleted the fix-patheditor-example branch May 3, 2020 08:36
@QuLogic QuLogic removed this from the v2.2-doc milestone May 3, 2020
@anntzer

anntzer commented May 3, 2020

Copy link
Copy Markdown
Contributor

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.

@rcomer

rcomer commented Apr 1, 2024

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants