matplotlib.widgets.Lasso#
- classmatplotlib.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 startingpointxy, 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, thecallback function is called andpassed the vertices of the selected path.
- useblitbool, default: True
Whether to use blitting for faster drawing (if supported by thebackend). See the tutorialFaster rendering by using blittingfor details.
- props: dict, optional
Lasso line properties. See
Line2Dfor valid properties.Defaultprops are:{'linestyle':'-','color':'black','lw':2}
Added in version 3.9.
- ax
Examples usingmatplotlib.widgets.Lasso#
On this page