PlotlyJS.jl icon indicating copy to clipboard operation
PlotlyJS.jl copied to clipboard

sync zoom

Open anj00 opened this issue 5 years ago • 2 comments

When I have subplots and interact with them (zoom). the zoom on x axes not synced

using PlotlyJS
x = 1:10; y = rand(10,2);
plot([Plot(x, y[:,1]), Plot(x, y[:,1])])

plot show up like this (great) image

However, then I zoom on one of the subplots, another one(s) keep their timescale intact image

I maybe not a bug, but (me) missing default/option set.

anj00 avatar May 24 '19 08:05 anj00

Actually one solution could be like this. It solves the zoom problem

x = 1:10; y = rand(10,2);
p = [Plot(x, y[:,1]), Plot(x, y[:,2])]
p.data[2][:xaxis] = "x1"
plot(p)

however, labels on x are gone (you get to see them on the top and then hover over). Ideally one of course would love to keep them image

anj00 avatar May 24 '19 09:05 anj00

Hi @anj00 thanks for posting.

Glad you were able to find the “shared x axis” fix. I’m not aware of another way to do this, but will try to take a look. It will likely take a few days before I have the time.

Because this is a feature of the plotly JavaScript library, you might find better or more insightful help by posting the community discussion board: https://community.plot.ly

sglyon avatar May 24 '19 11:05 sglyon