'Figure out if we are inside the canvas or not and update the
canvas enter/leave events'

def _update_pointer_position(self, guiEvent=None):

    xw = self._tkcanvas.winfo_rootx()
    yw = self._tkcanvas.winfo_rooty()
    (xp, yp) = self._tkcanvas.winfo_pointerxy()
    xc = (xp - xw)
    yc = (yp - yw)
    yc = (self.figure.bbox.height - yc)
    if 1:
        (self._lastx, self._lasty) = (xc, yc)
    elif 0:
        FigureCanvasBase.motion_notify_event(self, xc, yc, guiEvent)
    elif 0:
        if self.figure.bbox.contains(xc, yc):
            self.enter_notify_event(guiEvent, xy=(xc, yc))
        else:
            self.leave_notify_event(guiEvent)
