-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Allow Artists to show pixel data in cursor display #3989
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
Changes from 1 commit
34854db
7e0d1ca
97640da
139d820
17e4211
fcda62b
8ea9504
02456b8
641304c
3f20d3a
5850150
88b56be
aece695
07745c8
7626394
7b0b6b1
f5ff73f
ea565c6
1429206
e62b0e3
34b4df4
8f266a1
70983ff
cd0e52b
8ce3a6f
bac8dff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2794,7 +2794,7 @@ def mouse_move(self, event): | |
except (ValueError, OverflowError): | ||
pass | ||
else: | ||
artists = self.figure.hitlist(event) | ||
artists = event.inaxes.hitlist(event) | ||
artists.sort(key=lambda x: x.zorder) | ||
if artists: | ||
s += artists[-1].get_zdata(event) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why only the last one? Is it a thing to want to have more than one zdata at a time? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pelson - By default, there often isn't enough room in the cursor window for more than one. If nothing else, Tkinter does odd things when the string displayed in the cursor on the toolbar becomes larger than the box it's in. (The window resizes slightly, and it gives a visually jarring "jump" effect.) This is a semi-common gotcha when embedding matplotlib figures in Tk and using a custom For example, try the following:
|
||
|
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.
Something seems odd about checking if
artists
is empty after sorting the list. I know (providedartists
is a list) it won't error out, but still seems to me that the sort should go ahead and move within theif
block.Also, +1 for removing ye olden style DSU in favor of
sort(key=)
.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.
Good call, done.