情节在3d与R中的线框

时间:2014-09-12 11:37:06

标签: r plot

我正在尝试使用线框在3d中绘图,这是我的代码:

mecdf = function (nr, nc, x, u) # mecdf is the bivariate cumulative empiric function 
{  k = rep (TRUE, nr)
   for (j in 1:nc) k = k & (x [,j] <= u [j])
   sum (k) / nr
}

xc = round(runif(100), 2)
yc = round(runif(100), 2)
Da = cbind(xc, yc)

bcdfa<-rep(NA,100)
for (i in 1:100) {bcdfa[i]=mecdf(nrow(Da),ncol(Da),Da,Da[i,])}    
bcdfa

x<-cbind(xc,yc,bcdfa) # bcdfa is the value of the bcdfa in every (xc,yc) point



 ...........

是否可以将线框或其他功能与这些数据一起用于表示双变量累积分布函数?

1 个答案:

答案 0 :(得分:0)

这是单向的。

library(akima)
library(plot3D)
 bcfoo<-interp(xc,yc,bcdfa)

 persp3D(bcfoo$x,bcfoo$y,bcfoo$z)

the surface

 #plot points to verify overall shape

 scatter3D(xc,yc,bcdfa)

the data