Wolfgang Polasek <wolfgang.polasek <at> gmail.com> writes: > how to find a function for plotting polygon surface, like > polgon3d(xc,yc,obs) > > xc, yc ... coordinates > obs.... observations > result: persp plot with grid net over the coordinates
Don't know of an off-the-shelf solution. Generate a Delaunay triangulation of your (x,y) points and then plot the triangles with triangles3d? Something like set.seed(1001) x <- runif(20) y <- runif(20) z <- rnorm(20,(x-0.5)^2+(y-0.5^2)) z <- (z-min(z))/(diff(range(z))) library(tripack) tt <- tri.mesh(x,y) tt2 <- triangles(tt) library(rgl) tnodes <- c(t(tt2[,1:3])) triangles3d(x[tnodes],y[tnodes],z[tnodes],col="blue") bbox3d() ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.