X Tutup
Skip to content

Adding the artist data on mouse move event message#7102

Merged
tacaswell merged 2 commits intomatplotlib:masterfrom
fariza:artist-value-tool-message
Sep 15, 2016
Merged

Adding the artist data on mouse move event message#7102
tacaswell merged 2 commits intomatplotlib:masterfrom
fariza:artist-value-tool-message

Conversation

@fariza
Copy link
Copy Markdown
Member

@fariza fariza commented Sep 13, 2016

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

@tacaswell tacaswell added this to the 2.0.1 (next bug fix release) milestone Sep 13, 2016
if a.contains(event) and a.get_visible()]

if artists:
a = max(enumerate(artists), key=lambda x: x[1].zorder)[1]
Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Member Author

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

Copy link
Copy Markdown
Member Author

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?

Copy link
Copy Markdown
Member

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.

@fariza
Copy link
Copy Markdown
Member Author

fariza commented Sep 13, 2016

The failures are not related

@fariza
Copy link
Copy Markdown
Member Author

fariza commented Sep 14, 2016

@Kojoley I simplified as suggested. It works fine on my side

@tacaswell tacaswell merged commit 6f1c68e into matplotlib:master Sep 15, 2016
tacaswell added a commit that referenced this pull request Sep 15, 2016
ENH: Adding the artist data on mouse move event message
@tacaswell
Copy link
Copy Markdown
Member

backported to v2.x as f52af63

@QuLogic QuLogic modified the milestones: 2.0.1 (next bug fix release), 2.0 (style change major release) Dec 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

X Tutup