添加另一个系列到lines3图

时间:2014-05-07 12:18:32

标签: r plot rgl

我试图添加几个不同颜色的系列来表示每一行。我使用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) 

结果相当差:有时它只绘制一个,有时它绘制两条线,但网格没有显示。

0 个答案:

没有答案