-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[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
[mpl_toolkits] Fix picking for things drawn on parasite axes #5590
Conversation
34223ab
to
95c48f1
Compare
Cc: @leejjoon |
95c48f1
to
96591d1
Compare
96591d1
to
9430a05
Compare
324e651
to
79ce193
Compare
I think this one still comes up once in a while... Any chance it'll get looked at? |
a669e0e
to
8f8f748
Compare
7d40bc8
to
269656a
Compare
Sorry we missed that you rebased this. |
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. |
@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. |
But it seems a bit stupid to me now that I just straight up copied those methods from |
e7c1be6
to
8c459da
Compare
8c459da
to
c582fa1
Compare
Done (finally). |
Can someone else review this very old PR? |
Merging a PR after >3 years 🎆 🍾 😄 |
Thanks! 😄 |
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.