Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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
jklymak merged 2 commits into matplotlib:master from anntzer:do-import-qt5
Nov 17, 2017

Conversation

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

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
Copy link
Contributor Author

anntzer commented Oct 30, 2017
edited
Loading

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
Copy link
Contributor Author

anntzer commented Oct 30, 2017
edited
Loading

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.

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

Copy link
Contributor Author

anntzer commented Oct 30, 2017

I know...

afvincent reacted with laugh emoji

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.

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

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?

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?

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
Reviewers

@Kojoley Kojoley Kojoley left review comments

@jklymak jklymak jklymak approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v2.1.0-doc
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /