fastplotlib.LinearRegionSelectorΒΆ
- class LinearRegionSelector(bounds, limits, size, origin, axis='x', parent=None, resizable=True, fill_color=(0, 0, 0.35), edge_color=(0.8, 0.8, 0), edge_thickness=3, arrow_keys_modifier='Shift', name=None)[source]ΒΆ
Create a LinearRegionSelector graphic which can be moved only along either the x-axis or y-axis. Allows sub-selecting data from a
Graphic
or from multiple Graphics.bounds[0], limits[0], and position[0] must be identical.
Holding the right mouse button while dragging an edge will force the entire region selector to move. This is a when using transparent fill areas due to
pygfx
picking limitations.Note: Events get very weird if the values of bounds, limits and origin are close to zero. If you need a linear selector with small data, we recommend scaling the data and then using the selector.
- Parameters:
bounds ((int, int)) β the initial bounds of the linear selector
limits ((int, int)) β (min limit, max limit) for the selector
size (int) β height or width of the selector
axis (str, default "x") β βxβ | βyβ, axis for the selector
parent (Graphic, default
None
) β associate this selector with a parent Graphicresizable (bool) β if
True
, the edges can be dragged to resize the width of the linear selectionfill_color (str, array, or tuple) β fill color for the selector, passed to pygfx.Color
edge_color (str, array, or tuple) β edge color for the selector, passed to pygfx.Color
arrow_keys_modifier (str) β modifier key that must be pressed to initiate movement using arrow keys, must be one of: βControlβ, βShiftβ, βAltβ or
None
name (str) β name for this selector graphic
Features
- selection:
LinearRegionSelectionFeature
selection()
returns the current selector bounds in world coordinates. Useget_selected_indices()
to return the selected indices in data space, andget_selected_data()
to return the selected data. Useselection.add_event_handler()
to add callback functions that are called when the LinearSelector selection changes. See feature class for event pick_info table.