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

How to know graph's shift along the X-axis relative to its initial position after using 'pan' (drag tool)?

Hi, my dear friends! In the picture below there are some signals’ graphs. My question is how can I split graphs into different areas and get an option to move each graph inside its own area along X-axis? And after such movement I strongly need to know the shift relative to the graph’s initial position. I know that subplots give an opportunity to move each area separatly. But in this case there is no way to know the shift or I just don’t know how.

Hi @masterino you could do this with a plotly figure with subplots within a Dash app, since panning would trigger a relayoutData event. See for more details. The other solution is to use a FigureWidget with a callback to print the shift or save it in an array (see With just a normal plotly figure, the panning happens in the Javascript layer which does not send information back to Python so there is no way to know the shift.

1 Like

You are my hero, @Emmanuelle. Thanks a lot!