-
Notifications
You must be signed in to change notification settings - Fork 633
Multiple synchronized plots #298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yea, this currently isn't easy to do with |
Thank you, that would be a really great addition. |
I am little late to this conversation but @TonyDIRL you could do something like this: data(managers, package = "PerformanceAnalytics")
ds <- data.frame(dts = as.Date(zoo::index(managers)),
t1 = as.numeric(managers[,1]),
t2 = as.numeric(managers[,3]),
t3 = as.numeric(managers[,4]))
ds %>%
plot_ly(x = dts, y = t1, type = "scatter", name = "Time Series 1") %>%
add_trace(x = dts, y = t2, yaxis = "y2", type = "scatter", name = "Time Series 2") %>%
add_trace(x = dts, y = t3, yaxis = "y3", type = "scatter", name = "Time Series 3") %>%
layout(title = "Connected Y-Axis plot",
yaxis = list(title = "Series1", domain = c(0, 0.32)),
yaxis2 = list(title = "Series2",domain = c(0.33, 0.65)),
yaxis3 = list(title = "Series3",domain = c(0.66, 1))) I get something like this: visit here for live version @cpsievert I am definitely spamming |
Awesome, thank you |
Fixed via dd9a3fa |
Any chance of doing the same thing in Python? I am trying to decode @royr2 to have a similar thing with two different charts. |
Hello, Thanks for a great package and a helpful thread. I used the subplot command to create three synchronized plots and it worked but I noticed a bug (or maybe I am doing something wrong, please enlighten me!). Whenever I set the nrows to 3 the second and third plots from the top do not synch with the first plot (my x-axis is a date axis and I have a second x axis which is a difftime column). I did a workarond by adding a 4th row and setting its height to 0 that interestingly worked! This revealed another issue that the 0 height of a plot in subplot does not hide it, but rather shows it in a very small size. Could you please help me resolve this/these issue(s)? |
On trying 5 rows the issue resurfaced again. It seems the issue is appearing for me when I try subplot with 1 column and odd number rows. Thought to share this, maybe it helps investigating. |
Hi,
Really great library.
Is it possible to build multiple synchronized plots with plotly?
Specifically, I'm looking to emulate the behaviour of dygraphs:
https://rstudio.github.io/dygraphs/gallery-synchronization.html
In python its possible with subplots and the shared_yaxes / shared_xaxes params.
https://plot.ly/python/subplots/
Tried the following but no success:
Thank you
The text was updated successfully, but these errors were encountered: