def onHilite(self, ev):
if not hasattr(self,'<STR_LIT>'): self._active = dict()<EOL>under = self.figure.hitlist(ev)<EOL>enter = [a for a in under if a not in self._active]<EOL>leave = [a for a in self._active if a not in under]<EOL>print("<STR_LIT>","<STR_LIT:U+0020>".join([str(x) for x in under]))<EOL>for a in leave:<EOL><INDENT>if hasattr(a,'<STR_LIT>'):<EOL><INDENT>a.set_color(self._active[a])<EOL><DEDENT>elif hasattr(a,'<STR_LIT>'):<EOL><INDENT>a.set_edgecolor(self._active[a][<NUM_LIT:0>])<EOL>a.set_facecolor(self._active[a][<NUM_LIT:1>])<EOL><DEDENT>del self._active[a]<EOL><DEDENT>for a in enter:<EOL><INDENT>if hasattr(a,'<STR_LIT>'):<EOL><INDENT>self._active[a] = a.get_color()<EOL><DEDENT>elif hasattr(a,'<STR_LIT>'):<EOL><INDENT>self._active[a] = (a.get_edgecolor(),a.get_facecolor())<EOL><DEDENT>else: self._active[a] = None<EOL><DEDENT>for a in enter:<EOL><INDENT>if hasattr(a,'<STR_LIT>'):<EOL><INDENT>a.set_color('<STR_LIT>')<EOL><DEDENT>elif hasattr(a,'<STR_LIT>'):<EOL><INDENT>a.set_edgecolor('<STR_LIT>')<EOL>a.set_facecolor('<STR_LIT>')<EOL><DEDENT>else: self._active[a] = None<EOL><DEDENT>self.draw_idle()<EOL>
Mouse event processor which highlights the artists
under the cursor.  Connect this to the 'motion_notify_event'
using::

    canvas.mpl_connect('motion_notify_event',canvas.onHilite)