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

______________________________________________
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.

Reply via email to