Black Lives Matter. Please consider donating to Black Girls Code today.

Synch selection of two plots

Imagine I have two scatter plots.

Is there a way to synch the selection of the 2nd plot based on what is currently selected in the 1st plot? Assuming both plots display the same dataset.

Just get the selected points from the first plot using graphDiv.on("plotly_selected",selectFunction); Now determine the indexes of the selected points from the whole data. Now you can set the selected points on the 2nd plot using Plotly.restyle(graphDiv, {selectedpoints: [list-of-indexes]});

Oh! That simple?! Thanks a lot. I will give it a try.

Thanks a lot,

-m