Inheritance diagram for mpltools.widgets:
Bases: matplotlib.widgets.RectangleSelector
Widget widget for selecting a rectangular region in a plot.
Unlike matplotlib.widgets.RectangleSelector, this widget remains visible after selection and can be resized using corner and edge handles.
After making the desired selection, press “Enter” to accept the selection and call the onselect callback function.
Note the difference from matplotlib.widgets.RectangleSelector: The callback method onselect is called on “Enter”, not after release of the mouse button. In addition, the onselect function now takes a single argument extents, which is a tuple specifying (xmin, xmax, ymin, ymax) of the rectangle.
TODO: Allow rectangle to flip over itself when resizing.
Parameters : | ax : :class:`matplotlib.axes.Axes onselect : function
mindist : float
rectprops : dict
kwargs : see matplotlib.widgets.RectangleSelector. |
---|
Attributes
extents |
Methods
connect_event(event, callback) | Connect callback with an event. |
disconnect_events() | Disconnect all events created by this widget. |
get_active() | Get status of active mode (boolean variable) |
ignore(event) | return True if event should be ignored |
onkeypress(event) | |
onmove(event) | |
press(event) | |
release(event) | |
set_active(active) | Use this to activate / deactivate the RectangleSelector |
set_animated(val) | |
set_visible(val) | |
update() | |
update_background(event) | force an update of the background |
Connect callback with an event.
This should be used in lieu of figure.canvas.mpl_connect since this function stores call back ids for later clean up.
Corners of rectangle from lower left, moving clockwise.
Disconnect all events created by this widget.
Midpoint of rectangle edges from lower left, moving clockwise.
Get status of active mode (boolean variable)
return True if event should be ignored
Use this to activate / deactivate the RectangleSelector from your program with an boolean parameter active.
force an update of the background
Bases: matplotlib.widgets.Slider
Slider widget to select a value from a floating point range.
Parameters : | ax : Axes instance
value_range : (float, float)
label : str
value : float
on_slide : function
value_fmt : str
slidermin, slidermax : float
dragging : bool
pad : float
|
---|
Attributes
value |
Methods
connect_event(event, callback) | Connect callback with an event. |
disconnect(cid) | remove the observer with connection id cid |
disconnect_events() | Disconnect all events created by this widget. |
ignore(event) | Return True if event should be ignored. |
on_changed(func) | When the slider value is changed, call func with the new |
reset() | reset the slider to the initial value if needed |
set_val(value) | Set value of slider. |
Connect callback with an event.
This should be used in lieu of figure.canvas.mpl_connect since this function stores call back ids for later clean up.
remove the observer with connection id cid
Disconnect all events created by this widget.
Return True if event should be ignored.
This method (or a version of it) should be called at the beginning of any event callback.
When the slider value is changed, call func with the new slider position
A connection id is returned which can be used to disconnect
reset the slider to the initial value if needed
Set value of slider.