class_docstr: Camera implementing 2D pan/zoom mouse interaction.
  
  For this camera, the ``scale_factor`` indicates the zoom level, and
  the ``center`` indicates the center position of the view.
  
  By default, this camera inverts the y axis of the scene. This usually
  results in the scene +y axis pointing upward because widgets (including
  ViewBox) have their +y axis pointing downward.
  
  Parameters
  ----------
  rect : Rect
      A Rect object or 4-element tuple that specifies the rectangular
      area to show.
  aspect : float | None
      The aspect ratio (i.e. scaling) between x and y dimension of
      the scene. E.g. to show a square image as square, the aspect
      should be 1. If None (default) the x and y dimensions are scaled
      independently.
  **kwargs : dict
      Keyword arguments to pass to `BaseCamera`.
  
  Notes
  -----
  Interaction:
  
      * LMB: pan the view
      * RMB or scroll: zooms the view
class_docstr_tok: ["Camera","implementing","2D","pan\/zoom","mouse","interaction",".","For","this","camera",",","the","``","scale_factor","``","indicates","the","zoom","level",",","and","the","``","center","``","indicates","the","center","position","of","the","view",".","By","default",",","this","camera","inverts","the","y","axis","of","the","scene",".","This","usually","results","in","the","scene","+y","axis","pointing","upward","because","widgets","(","including","ViewBox",")","have","their","+y","axis","pointing","downward",".","Parameters","--","--","--","--","--","rect",":","Rect","A","Rect","object","or","4-element","tuple","that","specifies","the","rectangular","area","to","show",".","aspect",":","float","|","None","The","aspect","ratio","(","i.e",".","scaling",")","between","x","and","y","dimension","of","the","scene",".","E.g",".","to","show","a","square","image","as","square",",","the","aspect","should","be","1",".","If","None","(","default",")","the","x","and","y","dimensions","are","scaled","independently",".","*","*","kwargs",":","dict","Keyword","arguments","to","pass","to","`","BaseCamera","`",".","Notes","--","--","-","Interaction",":","*","LMB",":","pan","the","view","*","RMB","or","scroll",":","zooms","the","view"]
docstr: Zoom in (or out) at the given center
  
  Parameters
  ----------
  factor : float or tuple
      Fraction by which the scene should be zoomed (e.g. a factor of 2
      causes the scene to appear twice as large).
  center : tuple of 2-4 elements
      The center of the view. If not given or None, use the
      current center.
docstr_tok: ["Zoom","in","(","or","out",")","at","the","given","center","Parameters","--","--","--","--","--","factor",":","float","or","tuple","Fraction","by","which","the","scene","should","be","zoomed","(","e.g",".","a","factor","of","2","causes","the","scene","to","appear","twice","as","large",")",".","center",":","tuple","of","2-4","elements","The","center","of","the","view",".","If","not","given","or","None",",","use","the","current","center","."]
code: def zoom(self, factor, center=None):
      """Zoom in (or out) at the given center
  
      Parameters
      ----------
      factor : float or tuple
          Fraction by which the scene should be zoomed (e.g. a factor of 2
          causes the scene to appear twice as large).
      center : tuple of 2-4 elements
          The center of the view. If not given or None, use the
          current center.
      """
      # Init some variables
      center = center if (center is not None) else self.center
      assert len(center) in (2, 3, 4)
      # Get scale factor, take scale ratio into account
      if np.isscalar(factor):
          scale = [factor, factor]
      else:
          if len(factor) != 2:
              raise TypeError(
                  "factor must be scalar or length-2 sequence."
              )
          scale = list(factor)
      if self.aspect is not None:
          scale[0] = scale[1]
  
      # Make a new object (copy), so that allocation will
      # trigger view_changed:
      rect = Rect(self.rect)
      # Get space from given center to edges
      left_space = center[0] - rect.left
      right_space = rect.right - center[0]
      bottom_space = center[1] - rect.bottom
      top_space = rect.top - center[1]
      # Scale these spaces
      rect.left = center[0] - left_space * scale[0]
      rect.right = center[0] + right_space * scale[0]
      rect.bottom = center[1] - bottom_space * scale[1]
      rect.top = center[1] + top_space * scale[1]
      self.rect = rect
  
imports: from __future__ import division
  import numpy
  from .base_camera import BaseCamera
  from ...geometry import Rect
  from ...visuals.transforms import STTransform, MatrixTransform
label_desc: Use image node_id 4 for calling the PanZoomCamera obj's underlying member method code with example usage: obj.zoom(factor, center) without return types