Usage
Signature
Parameters
A matplotlib
Axes object. The full figure is rendered, but selections map to this axes’ coordinate space.If
True, the selection is only sent to Python on mouse-up. If False (the default), it streams while dragging.Attributes
The selected data, with
get_mask(x, y) returning a mask array corresponding to the selection.The associated matplotlib Axes object.
Selection Types
The figure is rendered as a static image with an interactive selection overlay:- Click and drag for box selection
- Hold the
Shiftkey and drag for lasso selection
BoxSelection
A rectangular box selection on a matplotlib plot. Attributes:x_min: Left boundary of the selectionx_max: Right boundary of the selectiony_min: Bottom boundary of the selectiony_max: Top boundary of the selection
get_mask(x, y): Get a boolean mask for points within this selection
LassoSelection
A freehand polygon (lasso) selection on a matplotlib plot. Attributes:vertices: The polygon vertices as a tuple of (x, y) pairs
get_mask(x, y): Get a boolean mask for points within this selection
EmptySelection
Sentinel representing no selection. Returned bymo.ui.matplotlib.value when nothing is selected.
Behaves like a selection with no points, and evaluates to False when coerced as a bool.
Methods:
get_mask(x, y): Return an all-Falsemask