Interactively harnessing the selected vertical span (the start and end x-coordinates ) in an audio (speech) plot

Hi,

In my app I plot some of my results using Plotly. While Plotly makes the plot interactive (zooming, selecting a portion of a plot, etc), yet I couldn’t find a way to herness the selected vertical span (the start and end x-coordinates ). That is, I want a user to be able to drag a vertical span (from x1 to x2) on the plot, and only the selected region to be displayed. To do so, I need to get access to the values of x1 and x2.

Plotly will zoom-in when you select a box or span by dragging your mouse, but I don’t get these numbers (x1, and x2). I’d like to save these numbers whenever a user selects a x-box, to do something for the user.

Can anyone please help?

Thanks

Hi @mrs2023

Perhaps you can look into using streamlit-plotly-events which appears to provide functionalities that you’re looking for.

Thanks. I have already looked at it, but this doesn’t provide what I want. I I want a user to be able to drag a vertical span (from x1 to x2) on the plot, and I can get the left and right x coordinate.