我正在使用 R 3.4.2 和包plotly 版本“4.7.1”
我首先准备这个情节(有效):
x = structure(c(1444262400, 1444348800, 1444608000, 1444694400, 1444780800,
1444867200, 1444953600, 1445212800, 1445299200, 1445385600, 1445472000,
1445558400, 1445817600, 1445904000, 1445990400, 1446076800, 1446163200
), tzone = "GMT", tclass = c("POSIXct", "POSIXt"), class = c("POSIXct",
"POSIXt"))
y = c(-68.1377966700034, -68.5283603030953, -68.533877757571, -66.7349127872575,
-66.0681953259191, -67.6301142574414, -69.6710392385029, -70.170692866109,
-70.0701763503189, -71.9537057278669, -72.0177423408879, -68.300778528265,
-68.559662880874, -68.5621379677293, -69.2857358836203, -73.4822677099078,
-75.3170151811821)
p = plotly::plot_ly(x = x, y = y, type = "scatter", mode = "lines", line=list(dash = NULL), name = "margin", visible = NULL) %>%
plotly::layout(xaxis = NULL, yaxis = list(type = "linear", title=NULL), title="margin", legend = NULL, shapes = NULL)
Run Code Online (Sandbox Code Playgroud)
然而下面的子图不起作用!
plotly::subplot(p, p, nrow=2, shareX = TRUE)
Run Code Online (Sandbox Code Playgroud)
我收到此错误:Error in plots[[i]][["frames"]] : subscript out of bounds
你有同样的错误吗?
| 归档时间: |
|
| 查看次数: |
3104 次 |
| 最近记录: |