Extract the coordinates of points selected by lasso tool

Hey Community, i am creating a scatter plot and i want to extract the location of points select by the user using lassotool.

data = {
    'x': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
    'y': [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]}

df = pd.DataFrame(data)

source = ColumnDataSource(df)

# Create a scatter plot
p = figure(width=400, height=400, tools='lasso_select', title='Image')
scatter = p.scatter('x', 'y', source=source)

Thanks in advance

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.