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

artist.set_picker(False) no longer keeps artists pickable#19031

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

Draft
anntzer wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
fromanntzer:false-picker

Conversation

anntzer
Copy link
Contributor

The documentation forset_picker currently states thatNone disables
picking,True enables picking, and a custom callable implements, well,
custom picking behavior. It turns out thatFalsealso enables
picking, because the relevant check is implemented inArtist.pickable,
which strictly checkspicker is not None (and also checks that the
artist has been added to a figure). This can indeed be verified with

frompylabimport*plot([1,2],picker=False);gcf().canvas.mpl_connect("pick_event",print)

and clicking on the line. Strictly speaking, the docs state nothing
aboutFalse, so the behavior does not violate the docs, but that's
clearly non-optimal behavior, which I'm proposing to change here.

PR Summary

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

The documentation for `set_picker` currently states that `None` disablespicking, `True` enables picking, and a custom callable implements, well,custom picking behavior.  It turns out that `False` *also* enablespicking, because the relevant check is implemented in `Artist.pickable`,which strictly checks `picker is not None` (and also checks that theartist has been added to a figure).  This can indeed be verified with```pythonfrom pylab import *plot([1, 2], picker=False); gcf().canvas.mpl_connect("pick_event", print)```and clicking on the line.  Strictly speaking, the docs state nothingabout `False`, so the behavior does not violate the docs, but that'sclearly non-optimal behavior, which I'm proposing to change here.
@anntzeranntzer added this to thev3.4.0 milestoneNov 27, 2020
@QuLogic
Copy link
Member

The deprecated call of.set_picker(0) would enable picking and setpickradius to 0, but now it will disable picking, no?

@anntzer
Copy link
ContributorAuthor

Fair point. Do you think this warrants a deprecation period? In which case the whole PR should perhaps be turned into a deprecation of the old behavior rather than fully modifying it as it does right now.

@jklymak
Copy link
Member

Is there a practical difference between a pick or radius zero and turning it off?

@anntzer
Copy link
ContributorAuthor

I think so? For a filled rectangle even with pickradius=0 you should be able to pick it anywhere in the rectangle.

@timhoffm
Copy link
Member

timhoffm commentedDec 15, 2020
edited
Loading

Also I suppose, for a line with pickradius 0 you can still pick it by clicking exactly on the pixel of that line? Apparently not.

Copy link
Member

@tacaswelltacaswell left a comment

Choose a reason for hiding this comment

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

Restarted appveyor.

Anyone can merge on CI green.

@QuLogicQuLogic added the status: needs comment/discussionneeds consensus on next step labelDec 19, 2020
@QuLogic
Copy link
Member

I'm not sure if the discussion is finished?

@anntzer
Copy link
ContributorAuthor

We may want to resolve#19039 first, indeed.

@QuLogicQuLogic modified the milestones:v3.4.0,v3.5.0Jan 28, 2021
@jklymakjklymak marked this pull request as draftApril 23, 2021 16:59
@QuLogicQuLogic modified the milestones:v3.5.0,v3.6.0Aug 21, 2021
@QuLogicQuLogic modified the milestones:v3.6.0,v3.7.0Jul 5, 2022
@tacaswelltacaswell modified the milestones:v3.7.0,v3.8.0Dec 16, 2022
@ksundenksunden modified the milestones:v3.8.0,future releasesAug 8, 2023
@github-actionsGitHub Actions
Copy link

Since this Pull Request has not been updated in 60 days, it has been marked "inactive." This does not mean that it will be closed, though it may be moved to a "Draft" state. This helps maintainers prioritize their reviewing efforts. You can pick the PR back up anytime - please ping us if you need a review or guidance to move the PR forward! If you do not plan on continuing the work, please let us know so that we can either find someone to take the PR over, or close it.

@github-actionsgithub-actionsbot added the status: inactiveMarked by the “Stale” Github Action labelNov 10, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tacaswelltacaswelltacaswell approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Labels
status: inactiveMarked by the “Stale” Github Actionstatus: needs comment/discussionneeds consensus on next stepstatus: needs rebase
Projects
None yet
Milestone
future releases
Development

Successfully merging this pull request may close these issues.

6 participants
@anntzer@QuLogic@jklymak@timhoffm@tacaswell@ksunden

[8]ページ先頭

©2009-2025 Movatter.jp