vispy.scene.cameras.panzoom.
PanZoomCamera
Bases: vispy.scene.cameras.base_camera.BaseCamera
vispy.scene.cameras.base_camera.BaseCamera
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.
scale_factor
center
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.
A Rect object or 4-element tuple that specifies the rectangular area to show.
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.
Keyword arguments to pass to BaseCamera.
Notes
Interaction:
LMB: pan the view RMB or scroll: zooms the view
LMB: pan the view
RMB or scroll: zooms the view
aspect
The ratio between the x and y dimension. E.g. to show a square image as square, the aspect should be 1. If None, the dimensions are scaled automatically, dependening on the available space. Otherwise the ratio between the dimensions is fixed.
The center location for this camera
The exact meaning of this value differs per type of camera, but generally means the point of interest or the rotation point.
pan
Pan the view.
The distance to pan the view, in the coordinate system of the scene.
rect
The rectangular border of the ViewBox visible area, expressed in the coordinate system of the scene.
Note that the rectangle can have negative width or height, in which case the corresponding dimension is flipped (this flipping is independent from the camera’s flip property).
flip
viewbox_mouse_event
The SubScene received a mouse event; update transform accordingly.
The event.
viewbox_resize_event
Modify the data aspect and scale factor, to adjust to the new window size.
zoom
Zoom in (or out) at the given center
Fraction by which the scene should be zoomed (e.g. a factor of 2 causes the scene to appear twice as large).
The center of the view. If not given or None, use the current center.