我需要通过时间绘制一些 2d 数据(因此是 3d)

I need to plot some 2d data through time (thus 3d)

我有一个 xts 数据对象:

> head(vixData[,2:8], 5)
              F1    F2    F3    F4    F5    F6    F7
2009-06-08 30.25 32.00 31.70 31.75 31.65 30.85 29.95
2009-06-09 29.10 30.95 30.95 31.15 31.10 30.40 29.45
2009-06-10 29.10 31.20 31.30 31.45 31.50 30.75 29.95
2009-06-11 28.10 30.60 30.75 30.90 31.00 30.20 29.25
2009-06-12 28.35 29.95 30.10 30.45 30.50 29.90 29.05

F1-F7会形成一条曲线,如下图:

plot(1:7, vixData[399,2:8], type = 'o', pch = 6)

我想做这个穿越时空。 xts 对象的行是生成曲线的每一天的值。我希望生成这样的东西:

我正在尝试使用 plot3D 和 surf3D,但我无法理解文档,也无法理解如何将数据帧转换为 surf3D 想要的内容。有什么想法或更好的包装建议吗?

我已尝试按照评论中的建议使用 lattice::wireframe,但我得到以下信息:

curveData <- vixData[-(1:100),2:8, drop = FALSE]
wireframe(t(as.matrix(curveData)), shade = TRUE, scales = list(arrows = FALSE),
      aspect = c(0.65, 0.25), drape = TRUE, 
      zlab = "Level", xlab = "Contract", ylab = "Time", panel.aspect = .75)

这看起来很接近!!但是 - 我希望我可以旋转图像并沿 'Time' 轴延伸一些,以提供更好的清晰度。有参数吗?我在文档中找不到它。

chartSeries3d 的源文件应该有帮助。此外,您可能对

source("http://www.quantmod.com/examples/chartSeries3d/chartSeries3d.alpha.R")
library("xts")
data("sample_matrix")
chartSeries3d0( as.xts( sample_matrix ), col=c("lightblue","blue"))

Excel 3D 曲面图是您的最佳选择。 甚至 Excel 2007 年都有那个图表。 你可以旋转轴,轻松改变颜色

click volcano data example