8000 Unify the three Qt5 embedding examples. by anntzer · Pull Request #9599 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Unify the three Qt5 embedding examples. #9599

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

Merged
merged 2 commits into from
Nov 17, 2017

Conversation

anntzer
Copy link
Contributor
@anntzer anntzer commented Oct 28, 2017

... and modernize them a bit.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

Copy link
Member
@Kojoley Kojoley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc/tutorials/introductory/sample_plots.rst:407:undefined label: sphx_glr_gallery_user_interfaces_embedding_in_qt4_sgskip.py

... and modernize them a bit.
@tacaswell
Copy link
Member

examples/user_interfaces/embedding_in_qt4_wtoolbar_sgskip.py is nice because it shows you do not have to sub-class FigureCanvas to embed it.

@tacaswell tacaswell added this to the v2.1.0-doc milestone Oct 30, 2017
@anntzer
Copy link
Contributor Author
anntzer commented Oct 30, 2017

Good point. In fact the subclassing in the other example is completely unnecessary -- I'll move everything to the non-subclassing style...

@anntzer anntzer changed the title Unify the three Qt5 embedding examples. [wip] Unify the three Qt5 embedding examples. Oct 30, 2017
@anntzer anntzer changed the title [wip] Unify the three Qt5 embedding examples. Unify the three Qt5 embedding examples. Oct 30, 2017
@anntzer
Copy link
Contributor Author
anntzer commented Oct 30, 2017

I wrote what is basically a completely new embedding example, which does not rely on subclassing the Canvas (that is totally unneeded, both here and in my experience), and still showcases having multiple canvases, including a dynamic one, and the corresponding toolbars.
I voluntarily fully redrew the dynamic canvas on each iteration even though that is a bit unefficient, because I don't think the point of the example is to showcase blitting or modification of an existing Line2D instance.

@afvincent
Copy link
Contributor

Quite unrelated, but the 2nd canvas of the new example illustrates quite well the issue #9546 (annoying behavior with the busy cursor).

@anntzer
Copy link
Contributor Author
anntzer commented Oct 30, 2017

I know...

Copy link
Member
@jklymak jklymak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example works well on my machine.

I found the new_timer command mysterious. I wonder if either the pre-amble or this chunk of code could have a link to the docs where this is described?

A quick search didn't indicate where this functionality is documented, other than backed_bases.py. I guess we need a proper animation tutorial? I don't think any of the animation examples show the use of this function.

@anntzer
Copy link
Contributor Author
anntzer commented Nov 17, 2017

I think the backend docs need to be rewritten in general, it's somewhere on my todo list...

@jklymak
Copy link
Member
jklymak commented Nov 17, 2017

Its fine, but do you need to do this versus just using the more vanilla Annimation module?

@anntzer
Copy link
Contributor Author
anntzer commented Nov 17, 2017

Probably the examples predate the animation module, I essentially just copy-pasted and trimmed their general approach. May be nice to further modernize them to use animation but perhaps not in this PR?

@jklymak
Copy link
Member
jklymak commented Nov 17, 2017

Yep, no problem. I'll merge...

@jklymak jklymak merged commit 37e79c6 into matplotlib:master Nov 17, 2017
@anntzer anntzer deleted the do-import-qt5 branch November 17, 2017 21:30
anntzer added a commit that referenced this pull request Nov 17, 2017
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.

5 participants
0