def zoom(self, *args):
if self._active == '<STR_LIT>':<EOL><INDENT>self._active = None<EOL><DEDENT>else:<EOL><INDENT>self._active = '<STR_LIT>'<EOL><DEDENT>if self._idPress is not None:<EOL><INDENT>self._idPress=self.canvas.mpl_disconnect(self._idPress)<EOL>self.mode = '<STR_LIT>'<EOL><DEDENT>if self._idRelease is not None:<EOL><INDENT>self._idRelease=self.canvas.mpl_disconnect(self._idRelease)<EOL>self.mode = '<STR_LIT>'<EOL><DEDENT>if  self._active:<EOL><INDENT>self._idPress = self.canvas.mpl_connect('<STR_LIT>', self.press_zoom)<EOL>self._idRelease = self.canvas.mpl_connect('<STR_LIT>', self.release_zoom)<EOL>self.mode = '<STR_LIT>'<EOL>self.canvas.widgetlock(self)<EOL><DEDENT>else:<EOL><INDENT>self.canvas.widgetlock.release(self)<EOL><DEDENT>for a in self.canvas.figure.get_axes():<EOL><INDENT>a.set_navigate_mode(self._active)<EOL><DEDENT>self.set_message(self.mode)<EOL>
activate zoom to rect mode