mpl_interactions.widgets.scatter_selector¶
- class scatter_selector(ax, x, y, pickradius=5, which_button=1, **kwargs)[source]¶
Bases:
matplotlib.widgets.AxesWidgetA widget for selecting a point in a scatter plot. callback will receive (index, (x, y))
- Attributes
activeIs the widget active?
- cids
Methods
connect_event(event, callback)Connect a callback function with an event.
disconnect_events()Disconnect all events created by this widget.
get_active()Get whether the widget is active.
ignore(event)Return whether event should be ignored.
on_changed(func)When a point is clicked calll func with the newly selected point
set_active(active)Set whether the widget is active.
- __init__(ax, x, y, pickradius=5, which_button=1, **kwargs)[source]¶
Create the scatter plot and selection machinery.
- Parameters
ax (Axes) – The Axes on which to make the scatter plot
x, y (float or array-like, shape (n, )) – The data positions.
pickradius (float) – Pick radius, in points.
which_button (int, default: 1) – Where 1=left, 2=middle, 3=right
- Other Parameters
**kwargs (arguments to scatter) – Other keyword arguments are passed directly to the
ax.scattercommand
Methods
__init__(ax, x, y[, pickradius, which_button])Create the scatter plot and selection machinery.
connect_event(event, callback)Connect a callback function with an event.
disconnect_events()Disconnect all events created by this widget.
get_active()Get whether the widget is active.
ignore(event)Return whether event should be ignored.
on_changed(func)When a point is clicked calll func with the newly selected point
set_active(active)Set whether the widget is active.
Attributes
activeIs the widget active?
cidsdrawoneventson