r - plotly multiple plot facet -


i'd multi plots 2 axis on each plot this

library(plotly) ay <- list(   tickfont = list(color = "green"),   overlaying = "y",   side = "right", title = "y2 axis title" )   par(mfrow=c(2,1)) ax <-list(title = "x axis title") ay1 <-list(title = "y1 axds title") plot_ly(x = 1:3, y = 10*(1:3), name = "slope of 10") %>%   add_trace(x = 2:4, y = 1:3, name = "slope of 1", yaxis = "y2") %>%   layout(title = "double y axis", yaxis2 = ay, xaxis = ax, yaxis = ay1)     ax <-list(title = "x axis title")  ay1 <-list(title = "y1 axds title")  plot_ly(x = 1:3, y = 10*(1:3), name = "slope of 10") %>%    add_trace(x = 2:4, y = 1:3, name = "slope of 1", yaxis = "y2") %>%    layout(title = "double y axis", yaxis2 = ay, xaxis = ax, yaxis = ay1)  

but when run code still see 1 plot. can plotly multiplots? can faceting 2 axis?

you looking subplot. check page more

library(plotly) ay <- list(     tickfont = list(color = "green"),     overlaying = "y",     side = "right", title = "y2 axis title" )  ax <-list(title = "x axis title") ay1 <-list(title = "y1 axds title")      subplot(         plot_ly(x = 1:3, y = 10*(1:3), name = "slope of 10") %>%             add_trace(x = 2:4, y = 1:3, name = "slope of 1", yaxis = "y2") %>%             layout(title = "double y axis", yaxis2 = ay, xaxis = ax, yaxis = ay1),          plot_ly(x = 1:3, y = 10*(1:3), name = "slope of 10") %>%             add_trace(x = 2:4, y = 1:3, name = "slope of 1", yaxis = "y2") %>%             layout(title = "double y axis", yaxis2 = ay, xaxis = ax, yaxis = ay1), nrows = 2) 

output

enter image description here


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -