matplotlib.widgets.Lasso#
- class matplotlib.widgets.Lasso(ax, xy, callback, *, useblit=True, props=None)[source]#
Bases:
AxesWidgetSelection curve of an arbitrary shape.
The selected path can be used in conjunction with
contains_pointto select data points from an image.Unlike
LassoSelector, this must be initialized with a starting point xy, and theLassoevents are destroyed upon release.- Parameters:
- ax
Axes The parent Axes for the widget.
- xy(float, float)
Coordinates of the start of the lasso.
- callbackcallable
Whenever the lasso is released, the callback function is called and passed the vertices of the selected path.
- useblitbool, default: True
Whether to use blitting for faster drawing (if supported by the backend). See the tutorial Faster rendering by using blitting for details.
- props: dict, optional
Lasso line properties. See
Line2Dfor valid properties. Default props are:{'linestyle' : '-', 'color' : 'black', 'lw' : 2}
Added in version 3.9.
- ax