How will i be able to zoom in like sumultaneosly over all the vertically stacked subplots together. Currently , if i say zoomin , i can only soom in on subplot 1 and rest all subplots remain the same. I am looking for , all the subplots to zoomin together with the same scale.
In Javascript, here is the codepen corresponding to the Python example above. Note that you have to use the matches property of the different x axes so that they all match together.
Thanks Emmanuelle, but itās not the use case I am interested in. The x axes cannot be shared because they are not on the same scale. The first X axis is defined by [x_min, x_max] and the second by [x_min/(1+z), x_max/(1+z)] (z is a fixed parameter), they are related but different. This use case could be achieved if I could āconnectā the zoom event from the first graph to the second, even if they donāt share the same axis. I think it would be a new feature for plotly, but maybe itās achievable through some hack ā¦
I found a way of doing this by catching zoom event with on(āplotly_relayoutāā¦) callback and applying it to the other graph using Plotly.relayout . I can make a codepen if someone is interested.
Hi, I have exactly the same problem and I would be interested in an example how to best do this.
What Iām most worried about is that I will get circular callbacks when applying the zoom to the other subplot so I guess we will need some hidden state?
Iāll try to make a simple example on codepen if thatās not clear enough (I cannot share my code for the moment and and anyway there are too many other things to be meaningful).
Thanks a lot @aliallaoui for the response. Actually I missed that you pointed out above that you are interested in JS plotly. I need to do it in Python. But I get the idea from your example and now Iām thinking I might achieve something similar with client side callbacks.