'the _press mouse button in zoom to rect mode callback'

def _press(self, event):

    if (self._ids_zoom != []):
        self._cancel_action()
    if (event.button == 1):
        self._button_pressed = 1
    elif (event.button == 3):
        self._button_pressed = 3
    else:
        self._cancel_action()
        return
    (x, y) = (event.x, event.y)
    self._xypress = []
    for (i, a) in enumerate(self.figure.get_axes()):
        if ((x is not None) and (y is not None) and a.in_axes(event) and a.get_navigate() and a.can_zoom()):
            self._xypress.append((x, y, a, i, a._get_view()))
    id1 = self.figure.canvas.mpl_connect('motion_notify_event', self._mouse_move)
    id2 = self.figure.canvas.mpl_connect('key_press_event', self._switch_on_zoom_mode)
    id3 = self.figure.canvas.mpl_connect('key_release_event', self._switch_off_zoom_mode)
    self._ids_zoom = (id1, id2, id3)
    self._zoom_mode = event.key
