widgets¶
Custom matplotlib widgets made for use in this library.
-
class
RangeSlider
(ax, label, valmin, valmax, valinit=None, valfmt=None, closedmin=True, closedmax=True, dragging=True, valstep=None, orientation='horizontal', **kwargs)[source]¶ Bases:
mpl_interactions.widgets.SliderBase
A slider representing a floating point range.
Create a slider from valmin to valmax in axes ax. For the slider to remain responsive you must maintain a reference to it. Call
on_changed()
to connect to the slider event.- Attributes
- valtuple[float]
Slider value.
-
on_changed
(func)[source]¶ When the slider value is changed call func with the new slider value
- Parameters
- funccallable
Function to call when slider is changed. The function must accept a numpy array with shape (2,) float as its argument.
- Returns
- int
Connection id (which can be used to disconnect func)
-
class
SliderBase
(ax, orientation, closedmin, closedmax, valmin, valmax, valfmt, dragging, valstep)[source]¶
-
class
scatter_selector
(ax, x, y, pickradius=5, which_button=1, **kwargs)[source]¶ Bases:
matplotlib.widgets.AxesWidget
A 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:
mpl_interactions.widgets.scatter_selector
A widget for selecting a point in a scatter plot. callback will receive the index of the selected point as an argument.
-
on_changed
(func)[source]¶ 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:
mpl_interactions.widgets.scatter_selector
A widget for selecting a point in a scatter plot. callbacks will receive the x,y position of the selected point as arguments.