get_selected_indices¶

LinearRegionSelector.get_selected_indices(graphic=None)[source]¶

Returns the indices of the Graphic data bounded by the current selection. This is useful because the bounds min and max are not necessarily the same as the Line Geometry positions x-vals or y-vals. For example, if if you used a np.linspace(0, 100, 1000) for xvals in your line, then you will have 1,000 x-positions. If the selection bounds are set to (0, 10), the returned indices would be (0, 100).

Parameters:

graphic (Graphic, optional) – if provided, returns the selection indices from this graphic instead of the graphic set as parent

Returns:

data indices of the selection, list of np.ndarray if graphic is LineCollection

Return type:

Union[np.ndarray, List[np.ndarray]]