0

我正在尝试添加几个具有不同颜色的线系列来代表每条线。我正在使用 OSX 和 RStudio 0.97.248

我的代码:

library(rgl)
x <- c(32.0672183,32.0672378,32.06729413,32.0683039,32.0674524,32.0673297,32.06724431,32.0674858,32.0682105)
y <- c(34.8408533,34.8408614,34.84103463,34.840861,34.8407371,34.8409077,34.84114677,34.840946,34.8410858)
z <- c(0,2,17,110,95,21,24,32,81)
a <- c(32.1672183,30.0672378,32.06729413,34.0683039,31.0674524,32.0373297,32.06724431,20.0674858,31.0682105)
b <- c(31.8408533,24.8408614,44.84103463,31.840861,30.8407371,30.8409077,24.84114677,34.840946,34.8410858)
c <- c(0,2,17,11,55,41,14,32,1)

lines3d(x,y,z,lwd=5, col="red") 
lines3d(a,b,c,lwd=5, col="blue", add=TRUE) 

结果相当糟糕:有时它只绘制一条,有时它绘制两条线但网格不显示。

4

0 回答 0