mpl_interactions.widgets module#
Custom matplotlib widgets made for use in this library.
- class SliderBase(ax, orientation, closedmin, closedmax, valmin, valmax, valfmt, dragging, valstep)[source]#
Bases:
AxesWidgetBase Class for all sliders.
- class scatter_selector(ax, x, y, pickradius=5, which_button=1, **kwargs)[source]#
Bases:
AxesWidgetA widget for selecting a point in a scatter plot. callback will receive (index, (x, y)).
- class scatter_selector_index(ax, x, y, pickradius=5, which_button=1, **kwargs)[source]#
Bases:
scatter_selectorA widget for selecting a point in a scatter plot.
Callbacks will receive the index of the selected point as an argument.
- on_changed(func)[source]#
Attach a callback for when points are selected.
When a point is clicked calll func with the newly selected point’s index and position as arguments.
- Parameters:
- funccallable
Function to call when slider is changed. The function must accept a single int as its arguments.
- Returns:
- int
Connection id (which can be used to disconnect func)
- class scatter_selector_value(ax, x, y, pickradius=5, which_button=1, **kwargs)[source]#
Bases:
scatter_selectorA widget for selecting a point in a scatter plot.
Callbacks will receive the x,y position of the selected point as arguments.
- on_changed(func)[source]#
Attach a callback for when points are selected.
When a point is clicked calll func with the newly selected point’s index as arguments.
- Parameters:
- funccallable
Function to call when slider is changed. The function must accept a single int as its arguments.
- Returns:
- int
Connection id (which can be used to disconnect func)