Skip to content

Commit 6d2a63b

Browse files
committed
MNT : deprecate FigureCanvasBase.onHilite
This function has not been used internal since _at least_ 2007.
1 parent d014a8d commit 6d2a63b

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,12 +1678,6 @@ def __init__(self, figure):
16781678
self.mouse_grabber = None # the axes currently grabbing mouse
16791679
self.toolbar = None # NavigationToolbar2 will set me
16801680
self._is_saving = False
1681-
if False:
1682-
## highlight the artists that are hit
1683-
self.mpl_connect('motion_notify_event', self.onHilite)
1684-
## delete the artists that are clicked on
1685-
#self.mpl_disconnect(self.button_pick_id)
1686-
#self.mpl_connect('button_press_event',self.onRemove)
16871681

16881682
def is_saving(self):
16891683
"""
@@ -1734,15 +1728,19 @@ def onHilite(self, ev):
17341728
17351729
canvas.mpl_connect('motion_notify_event',canvas.onHilite)
17361730
"""
1731+
msg = ("onHilite has been deprecated in 1.5 and will be removed "
1732+
"in 1.6. This function has not been used internal by mpl "
1733+
"sense 2007.")
1734+
warnings.warn(msg, mplDeprecation)
17371735
if not hasattr(self, '_active'):
17381736
self._active = dict()
17391737

17401738
under = self.figure.hitlist(ev)
17411739
enter = [a for a in under if a not in self._active]
17421740
leave = [a for a in self._active if a not in under]
1743-
#print "within:"," ".join([str(x) for x in under])
1744-
#print "entering:",[str(a) for a in enter]
1745-
#print "leaving:",[str(a) for a in leave]
1741+
# print "within:"," ".join([str(x) for x in under])
1742+
# print "entering:",[str(a) for a in enter]
1743+
# print "leaving:",[str(a) for a in leave]
17461744
# On leave restore the captured colour
17471745
for a in leave:
17481746
if hasattr(a, 'get_color'):

0 commit comments

Comments
 (0)