mpl_pan_zoom package#
Module contents#
- class MouseButton(value)[source]#
Bases:
IntEnumAn enumeration.
- BACK = 8#
- FORWARD = 9#
- LEFT = 1#
- MIDDLE = 2#
- RIGHT = 3#
- class PanManager(fig, button)[source]#
Bases:
objectEnable panning a plot with any mouse button.
pan = PanManager(my_figure) # Let it be disabled and garbage collected pan = None
- Parameters:
- buttonint
Determines which button will be used (default right click). Left: 1 Middle: 2 Right: 3
- disable()[source]#
Disable the PanManager.
- Raises:
- RuntimeError
If the PanManager is already disabled.
- enable()[source]#
Enable the PanManager.
It should not be necessary to call this function unless it’s used after a call to
PanManager.disable().- Raises:
- RuntimeError
If the PanManager is already enabled.
- zoom_factory(ax, base_scale=1.1, auto_centering: bool = False)[source]#
Add ability to zoom with the scroll wheel.
- Parameters:
- axmatplotlib axes object
axis on which to implement scroll to zoom
- base_scalefloat
how much zoom on each tick of scroll wheel
- auto_centering: bool
whether to auto center zoom
- Returns:
- disconnect_zoomfunction
call this to disconnect the scroll listener