How can I show the number of selected scatterplot markers in Jupter notebook?

I’m using FigureWidget() in Jupyter Notebook

import plotly.graph_objs as go

fig = go.FigureWidget(
    data=go.Scatter(...),
)
fig

and would like to show the number of markers selected via"Lasso Select". Selection events don’t work in my case. How can I get this working pragmatically (means no Dash, etc.)?

Hi @fkromer can you explain why “selection events don’t work in your case”? You’ll need to define a callback function to tie the javascript event of lasso select to the operation of retrieving the number of points, this is what is done in the tutorial you link to.

Hi @Emmanuelle, sorry for the false report. The example works just fine and the table is updated according to the box select and lasso select. Pls don’t ask why the table seemed to be not updated last time I tried it :slight_smile:

Great, glad it worked out! Happy coding ;-).