scisalt.matplotlib.RectangleSelector

class scisalt.matplotlib.RectangleSelector(ax, *args, selfunc=None, parent=None, verbose=False, **kwargs)[source]

Add rectangle selection to an already-existing axis. *args and **kwargs pass through to matplotlib.widgets.RectangleSelector.

Use key A or a to toggle whether the rectangle is active or not.

verbose controls whether selections are printed to the terminal.

New in version 1.2.

Parameters:

ax : matplotlib.axis.Axis

The axis to plot to.

args :

selfunc : function, optional

A function to be executed on rectangle selection.

parent : object, optional

Stores the parent object.

verbose : bool, optional

Determines whether verbose output is used.

kwargs :

Attributes

RectangleSelector The instance of matplotlib.widgets.RectangleSelector.
ax The axis used.
eclick The starting mouse click from RectangleSelector.
erelease The ending mouse click from RectangleSelector.
height Height of rectangle.
parent The parent object.
selfunc A placeholder for the function called on each mouse release.
selfunc_results The results of selfunc(instance) where instance is this class.
verbose Determines whether rectangle coordinates are printed to the terminal on selection.
width Width of rectangle.
x0 Minimum x coordinate of rectangle.
x1 Maximum x coordinate of rectangle.
xslice A list [x0, x1].
y0 Minimum y coordinate of rectangle.
y1 Maximum y coordinate of rectangle.
yslice A list [y0, y1].