我找到了一種替代方法:使用包rgl I和函數表面3D,我可以在一個open3d窗口中堆疊多個3D表面圖。讓我們看一個小例子:
library("rgl")
data2_I<-matrix(c(1.0,1.0,0.6,0.6,0.7,0.9,0.9,0.5,0.5,0.5,0.7,0.9,0.9,0.6,0.3,0.4,0.7,0.9,0.9,0.7,0.5,0.5,0.6,0.9,0.9,0.7,0.6,0.6,1.0,1.0), nrow=5)
data0_I<-matrix(c(1.0,1.0,0.6,0.6,0.7,0.9,0.9,0.5,0.5,0.5,0.7,0.9,0.9,0.6,0.3,0.4,0.7,0.9,0.9,0.7,0.5,0.5,0.6,0.9,0.9,0.7,0.6,0.6,1.0,1.0), nrow=5)
data1_I<-2*data0_I
data2_I<-1/data1_I
elv=0
offs=5*elv+1
z0 <- scale*data0_I
z1 <- scale*data1_I
z2 <- scale*data2_I
x <- 1:nrow(z0)
y <- 1:ncol(z0)
palette <- colorRampPalette(c("blue","green","yellow", "red"))
col.table <- palette(256)
open3d(windowRect=c(50,50,800,800))
surface3d(x, y, elv*z0, color = col.table[cut(z0, 256)], back = "lines")
surface3d(x, y, elv*z1+1*offs, color = col.table[cut(z1, 256)], back = "lines")
surface3d(x, y, elv*z2+2*offs, color = col.table[cut(z2, 256)], back = "lines")
axes3d()
aspect3d(1,1,2)
變量offsand ELV包括用於美容目的:取捨控制兩個面圖和高程surface3d-地塊的z軸應該如何擴展之間的空間。由於我想有一個沒有任何高程的2D曲面繪圖,我將它設置爲零。
你應該包含與'TPS'相關的庫函數。另外,這個例子不是可重複的 - 如果你給我們一個獨立的例子(我們沒有'data2_I'),人們更可能幫助你。 – jbaums 2015-02-28 00:03:02
Ups,對不起,我忘記了包含這些數據。 – 2015-03-01 01:02:19