An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090317/fa75fa0e/attachment-0002.pl>
help with 3-D plot of kernel density estimates
2 messages · T Joshi, Duncan Murdoch
On 17/03/2009 6:44 AM, Josh wrote:
Hi, I guess I have a naive question. I use kde2d function in a standard way to estimate kernel densities of x and y (x and y are vectors) and plot them using image(). f1=kde2d(x,y) image(f1) But what if I want to see kernel estimates of three variables, x, y and z (a vector) plotted together ? Something in which x<->y is plotted and colored according to the corresponding value of z ?
See the kde3d example in the misc3d package for contour plots of a 3d density function (not as you described, but very nicely done). Or if you just want 3d plots of a 2d function, you can use persp (from graphics) or persp3d (from rgl). Duncan Murdoch