10000 Merge pull request #17372 from anntzer/mos · matplotlib/matplotlib@904227b · GitHub
[go: up one dir, main page]

Skip to content

Commit 904227b

Browse files
authored
Merge pull request #17372 from anntzer/mos
Auto-set artist.mouseover based on if get_cursor_data is overridden.
2 parents 35fd945 + d174bb0 commit 904227b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/matplotlib/artist.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ def __init__(self):
8585
self._contains = None
8686
self._rasterized = None
8787
self._agg_filter = None
88-
self._mouseover = False
88+
# Normally, artist classes need to be queried for mouseover info if and
89+
# only if they override get_cursor_data.
90+
self._mouseover = type(self).get_cursor_data != Artist.get_cursor_data
8991
self.eventson = False # fire events only if eventson
9092
self._oid = 0 # an observer id
9193
self._propobservers = {} # a dict from oids to funcs

lib/matplotlib/image.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ def __init__(self, ax,
241241
):
242242
martist.Artist.__init__(self)
243243
cm.ScalarMappable.__init__(self, norm, cmap)
244-
self._mouseover = True
245244
if origin is None:
246245
origin = mpl.rcParams['image.origin']
247246
cbook._check_in_list(["upper", "lower"], origin=origin)

0 commit comments

Comments
 (0)
0