-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Adding the artist data on mouse move event message #7102
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
Adding the artist data on mouse move event message #7102
Conversation
if a.contains(event) and a.get_visible()] | ||
|
||
if artists: | ||
a = max(enumerate(artists), key=lambda x: x[1].zorder)[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is not a = max(artists, key=lambda x: x.zorder)
is the same as this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My guess is that it is but to be honest, I didn't check, I just copy/paste from backend_bases.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tacaswell as you are the original author of that line, do you see a problem with @Kojoley suggestion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at this earlier today and have a memory of doing it this way intentionally, but no longer remember the why.
The discussion at https://github.com/matplotlib/matplotlib/pull/4813/files is not enlightening and I can not even claim I just carried through some older code.
I think making that change is fine.
The failures are not related |
@Kojoley I simplified as suggested. It works fine on my side |
ENH: Adding the artist data on mouse move event message
backported to v2.x as f52af63 |
In the tools we didn't add the artist data to the message on mouse move event.
Also added a small check, for
get_visible
artist list, this is because if the artist is not visible we shouldn't show its data