matplotlib.widgets._SelectorWidget#
- classmatplotlib.widgets._SelectorWidget(ax,onselect=None,useblit=False,button=None,state_modifier_keys=None,use_data_coordinates=False)[source]#
Bases:
AxesWidgetThe base class for selector widgets.
This class provides common functionality for selector widgets,such as handling mouse and keyboard events, managing state modifier keys, etc.
The class itself is private and may be changed or removed without prior warning.However, the public API it provides to subclasses is stable and consideredpublic on the subclasses.
- add_state(state)[source]#
Add a state to define the widget's behavior. See thestate_modifier_keys parameter in the constructor of the concreteselector class for details.
- Parameters:
- statestr
Must be a supported state of the selector. See thestate_modifier_keys parameter in the constructor of the concreteselector class for details.
- Raises:
- ValueError
When the state is not supported by the selector.
- propertyartists#
Tuple of the artists of the selector.
- ignore(event)[source]#
Return whetherevent should be ignored.
This method should be called at the beginning of any event callback.
- remove_state(state)[source]#
Remove a state to define the widget's behavior. See thestate_modifier_keys parameter in the constructor of the concreteselector class for details.
- Parameters:
- statestr
Must be a supported state of the selector. See thestate_modifier_keys parameter in the constructor of the concreteselector class for details.
- Raises:
- ValueError
When the state is not supported by the selector.
- set_handle_props(**handle_props)[source]#
Set the properties of the handles selector artist. See thehandle_props argument in the selector docstring to know whichproperties are supported.
- set_props(**props)[source]#
Set the properties of the selector artist.
See theprops argument in the selector docstring to know which properties aresupported.
- propertyuseblit#
Return whether blitting is used (requested and supported by canvas).
Examples usingmatplotlib.widgets._SelectorWidget#
Select indices from a collection using polygon selector