【发布时间】:2018-05-30 15:08:41
【问题描述】:
我想用 Plotly 为时间序列绘制一个 3D 线图,并在每条线下填充。我这里有一个示例代码。
library(plotly)
dens <- with(diamonds, tapply(price, INDEX = cut, density))
data <- data.frame(
x = unlist(lapply(dens, "[[", "x")),
y = unlist(lapply(dens, "[[", "y")),
cut = rep(names(dens), each = length(dens[[1]]$x)))
p <- plot_ly(data, x = ~cut, y = ~x, z = ~y, type = 'scatter3d', mode = 'lines', color = ~cut)
p
使用此代码,我可以生成此图
没有填充的3d线图
我已经尝试过surfaceaxis=0、1 或 2,但它们产生了错误的填充物。
3D-Plotly 填充错误
我想要的是填充 x 轴和线图之间的区域。
有一个带有其他值的示例 3D 图。
以 3D-Plot 为例,在曲线下填充其他值
有人可以建议一种方法吗?提前谢谢你。
编辑:它必须用包“plotly”创建
【问题讨论】:
-
plotly 包中不是 R 特定的错误。我们应该等待发布:github.com/plotly/plotly.py/issues/1206
标签: r 3d plotly r-plotly space-filling-curve