get_selected_data#
- LinearRegionSelector.get_selected_data(graphic=None)[source]#
Get the
Graphicdata bounded by the current selection. Returns a view of the data array.If the
Graphicis a collection, such as aLineStack, it returns a list of views of the full array. Can be performed on theparentGraphic or on another graphic by passing to thegraphicarg.NOTE: You must be aware of the axis for the selector. The sub-selected data that is returned will be of shape
[n_points_selected, 3]. If you have selected along the x-axis then you can access y-values of the subselection like this: sub[:, 1]. Conversely, if you have selected along the y-axis then you can access the x-values of the subselection like this: sub[:, 0].- Parameters:
graphic (Graphic, optional, default
None) – if provided, returns the data selection from this graphic instead of the graphic set asparent- Returns:
view or list of views of the full array, returns
Noneif selection is empty- Return type:
np.ndarray or List[np.ndarray]