docstr: Factors less than zero zoom in, and greater than zero zoom out.
  
  If mouse_coords is given, the point under the mouse stays stationary
  while zooming. mouse_coords should come from MouseEvent.pos.
docstr_tok: ["Factors","less","than","zero","zoom","in",",","and","greater","than","zero","zoom","out",".","If","mouse_coords","is","given",",","the","point","under","the","mouse","stays","stationary","while","zooming",".","mouse_coords","should","come","from","MouseEvent.pos","."]
code: def zoom(self, factor, mouse_coords=None):
      """Factors less than zero zoom in, and greater than zero zoom out.
  
      If mouse_coords is given, the point under the mouse stays stationary
      while zooming. mouse_coords should come from MouseEvent.pos.
  
      """
      if mouse_coords is not None:  # Record the position of the mouse
          x, y = float(mouse_coords[0]), float(mouse_coords[1])
          x0, y0 = self.pixel_to_coords(x, y)
  
      self.scale *= factor
      self.scale = max(min(self.scale, self.max_scale), self.min_scale)
      self.program["scale"] = self.scale
  
      # Translate so the mouse point is stationary
      if mouse_coords is not None:
          x1, y1 = self.pixel_to_coords(x, y)
          self.translate_center(x1 - x0, y1 - y0)
  
file_path: vispy/examples/demo/gloo/mandelbrot.py
imports: from vispy import app, gloo
label_desc: Use image node_id 10 for calling the Canvas obj's underlying member method code with example usage: obj.zoom(factor, mouse_coords) without return types