Skip to content

Cleanup RectangleSelector example. - #17475

Merged
QuLogic merged 1 commit into
matplotlib:masterfrom
anntzer:rse
May 22, 2020
Merged

QuLogic merged 1 commit into
matplotlib:masterfrom
anntzer:rse

Conversation

@anntzer

@anntzer anntzer commented May 21, 2020

Copy link
Copy Markdown
Contributor
  • Don't use "q" or "a" as keys given that they are already mapped to
    "quit" and "all_axes" (even though the latter is deprecated).
  • Document the interactivity directly as the axes title.
  • No need to plot too many things in the axes; they're irrelevant.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 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

@timhoffm timhoffm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Um, when I toggle to deactivate and then toggle again to activate, I cannot control the existing rectangle, but a new one is drawn on top.

grafik

However, it doesn't seem your code is responsible. Likely some bug in rectangle selector (but cannot easily test as deactivating did not work in the original example due to duplicate key assignment. So I just approve the obvious improvement of you PR.

Comment thread examples/widgets/rectangle_selector.py Resolved
@anntzer

anntzer commented May 21, 2020

Copy link
Copy Markdown
Contributor Author

the bug is tracked at #17476.

@QuLogic

QuLogic commented May 21, 2020

Copy link
Copy Markdown
Member

The example in the class docstring for RectangleSelector uses these same keys, and should probably be synced with this example.

@timhoffm

Copy link
Copy Markdown
Member

Possibly, the example in the class docstring should be replaced by a link to this example.

- Don't use "q" or "a" as keys given that they are already mapped to
  "quit" and "all_axes" (even though the latter is deprecated).
- Document the interactivity directly as the axes title.
- No need to plot too many things in the axes; they're irrelevant.
@anntzer

anntzer commented May 21, 2020

Copy link
Copy Markdown
Contributor Author

indeed, just made a link instead.

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.

3 participants