这里我们主要使用 plot3D[2] 包中的 scatter3D 函数进行绘制,当然也可以尝试使用 Scatterplot3d[3] 包。
首先构造一些模拟数据作为例子。...length = 5)
z = matrix(NA,length(x),5)
for(i in 1:length(mean1)){
z[,i] = dnorm(x,mean1[i],1)
}
之后使用 scatter3D...scatter3D(x, rep(1,len), z[,1], bty = "b2",colkey = FALSE,
phi = 14,theta = 45,
pch...for(i in 1:length(mean1)){
scatter3D(x, rep(i,len), z[,i], add = TRUE,type ='l', col = col[i], pch...= 16)
scatter3D(x[which.max(z[,i])], y[i], 0 , add = TRUE, type ='h', col = col[i], pch = 16)
}
添加密度函数和点估计