Movatterモバイル変換


[0]ホーム

URL:


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

Allow Selectors to be dragged from anywhere within their patch#19657

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
QuLogic merged 1 commit intomatplotlib:masterfromdstansby:selector-dragging
Apr 16, 2021

Conversation

dstansby
Copy link
Member

PR Summary

As it says in the what's new entry:

The~matplotlib.widgets.RectangleSelector and~matplotlib.widgets.EllipseSelector have a new keyword argument,select_whole_region, which when set toTrue allows you to click and drag from anywhere inside the selector to move it. Previously it was only possible to move it by either activating the move modifier button, or clicking on the central handle.

Questions:

  • Any opinions on turning this on by default?
  • Does anyone have any better ideas for the keyword argument name?select_whole_region is the best I came up with, but it doesn't feel great.

Here's an example:

Screen.Recording.2021-03-06.at.16.53.58.mov

PR Checklist

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (runflake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).
  • Conforms to Matplotlib style conventions (installflake8-docstrings and runflake8 --docstring-convention=all).
  • New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).

@ianhi
Copy link
Contributor

Does anyone have any better ideas for the keyword argument name? select_whole_region is the best I came up with, but it doesn't feel great.

drag_from_anywhere?

dstansby reacted with thumbs up emoji

Copy link
Member

@QuLogicQuLogic left a comment

Choose a reason for hiding this comment

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

I think you may have rebased and reverted the changes I suggested.

@@ -44,6 +44,36 @@ def test_rectangle_selector():
check_rectangle(rectprops=dict(fill=True))


@pytest.mark.parametrize('drag_from_anywhere, new_center',
[[True, (60, 75)],
[False, (30, 20)]])
Copy link
Member

Choose a reason for hiding this comment

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

If you're not dragging from the center, and you didn't enable the new option, why is the center now(30, 20) instead of remaining at(50, 65)?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This is because dragging withdrag_from_anywhere=False creates a new rectangle, which has a center (30, 20). I'll add some more comments to the test to make it clearer what's going on.

@dstansby
Copy link
MemberAuthor

Sorry about the review comments, they should all be implemented now. I've added some more comments to the test too - let me know if anything remains unclear.

@QuLogicQuLogic added this to thev3.5.0 milestoneApr 16, 2021
@QuLogicQuLogic merged commitc89cf88 intomatplotlib:masterApr 16, 2021
@dstansbydstansby deleted the selector-dragging branchApril 17, 2021 10:01
@ericpreericpre mentioned this pull requestApr 29, 2021
7 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.5.0
Development

Successfully merging this pull request may close these issues.

4 participants
@dstansby@ianhi@QuLogic@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp