Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[mpl_toolkits] Fix picking for things drawn on parasite axes #5590

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

Conversation

smheidrich
Copy link
Contributor

Second attempt at fixing #5581 .

This time it is done by implementing custom pick methods for host and parasite axes classes.
In actuality the pick methods are both stolen from Artist.pick and extended, I'm not sure if I should remove that duplicate wall-of-text comment.

Also added tests that check if this behaves exactly as picking on "normal axes" (pyplot.gca() on a clean slate) does even for overlapping objects.

@smheidrich smheidrich force-pushed the fix_mpl_toolkit_twin_picking2 branch 2 times, most recently from 34223ab to 95c48f1 Compare November 30, 2015 23:00
@mdboom
Copy link
Member

mdboom commented Dec 1, 2015

Cc: @leejjoon

@smheidrich smheidrich force-pushed the fix_mpl_toolkit_twin_picking2 branch from 95c48f1 to 96591d1 Compare January 19, 2016 20:31
@smheidrich smheidrich force-pushed the fix_mpl_toolkit_twin_picking2 branch from 96591d1 to 9430a05 Compare June 11, 2016 18:57
@smheidrich smheidrich force-pushed the fix_mpl_toolkit_twin_picking2 branch 5 times, most recently from 324e651 to 79ce193 Compare December 9, 2017 01:54
@jklymak jklymak added this to the v3.0 milestone May 16, 2018
@jklymak
Copy link
Member

jklymak commented May 16, 2018

I think this one still comes up once in a while... Any chance it'll get looked at?

@smheidrich smheidrich force-pushed the fix_mpl_toolkit_twin_picking2 branch 2 times, most recently from a669e0e to 8f8f748 Compare May 17, 2018 09:57
@jklymak jklymak modified the milestones: v3.0, v3.1 Jul 9, 2018
@smheidrich smheidrich force-pushed the fix_mpl_toolkit_twin_picking2 branch 3 times, most recently from 7d40bc8 to 269656a Compare January 4, 2019 15:31
@jklymak
Copy link
Member

jklymak commented Feb 9, 2019

Sorry we missed that you rebased this.

@jklymak
Copy link
Member

jklymak commented Feb 9, 2019

I wasn't quite sure how firing works for overlapped artists? If two artists overlap do they both fire the pick? If so, this looks right. If one of the artists is supposed to be picked, then this seems to pick both of them.

@smheidrich
Copy link
Contributor Author

@jklymak I wasn't sure either, which is why the tests also check how picking on "regular" axes works to make sure it does the same thing. If the behavior on regular axes is ever changed, the tests will fail and hopefully signal that the behavior for parasite axes should be changed in accordance.

@smheidrich
Copy link
Contributor Author

But it seems a bit stupid to me now that I just straight up copied those methods from Artist... let me check if this can't be solved with just super()...

@smheidrich smheidrich force-pushed the fix_mpl_toolkit_twin_picking2 branch 7 times, most recently from e7c1be6 to 8c459da Compare February 12, 2019 01:40
@tacaswell tacaswell modified the milestones: v3.1.0, v3.2.0 Feb 12, 2019
@smheidrich smheidrich force-pushed the fix_mpl_toolkit_twin_picking2 branch from 8c459da to c582fa1 Compare February 12, 2019 10:08
@smheidrich
Copy link
Contributor Author

Done (finally).

@jklymak
Copy link
Member

jklymak commented Feb 12, 2019

Can someone else review this very old PR?

@timhoffm timhoffm merged commit 95c583a into matplotlib:master Feb 14, 2019
@timhoffm
Copy link
Member

Merging a PR after >3 years 🎆 🍾 😄

@QuLogic QuLogic modified the milestones: v3.2.0, v3.1.0 Feb 15, 2019
@smheidrich
Copy link
Contributor Author

Thanks! 😄

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.

7 participants