parameters: (self, event)
docstring: Respond to scroll events: zoom in/out
docstring_summary: Respond to scroll events: zoom in/out
docstring_tokens: Respond to scroll events : zoom in / out
function: def on_scroll(self, event):
          """Respond to scroll events: zoom in/out"""
          self.canvas.toolbar.push_current()
          if not getattr(event, 'inaxes', None) or isinstance(event.inaxes, Axes3D) or \
                  len(event.inaxes.images) == 0 and len(event.inaxes.lines) == 0:
              return
          zoom_factor = 1.05 + abs(event.step) / 6
          if event.button == 'up':  # zoom in
              zoom(event.inaxes, event.xdata, event.ydata, factor=zoom_factor)
          elif event.button == 'down':  # zoom out
              zoom(event.inaxes, event.xdata, event.ydata, factor=1 / zoom_factor)
          event.canvas.draw()
function_tokens: def on_scroll ( self , event ) : self . canvas . toolbar . push_current ( ) if not getattr ( event , 'inaxes' , None ) or isinstance ( event . inaxes , Axes3D ) or len ( event . inaxes . images ) == 0 and len ( event . inaxes . lines ) == 0 : return zoom_factor = 1.05 + abs ( event . step ) / 6 if event . button == 'up' : # zoom in zoom ( event . inaxes , event . xdata , event . ydata , factor = zoom_factor ) elif event . button == 'down' : # zoom out zoom ( event . inaxes , event . xdata , event . ydata , factor = 1 / zoom_factor ) event . canvas . draw ( )