Re: [R] 2-dim density plot

2011-08-11 Thread annie Zhang
Thank you so much, Michael and Duncan. It worked. Annie On Thu, Aug 11, 2011 at 2:23 PM, Duncan Murdoch wrote: > On 11/08/2011 3:11 PM, annie Zhang wrote: > >> Hi All, >> >> I have a 2-dim density defined on 0> formula of the density. How can I visualize it? What plot functions can I >> use? >>

Re: [R] 2-dim density plot

2011-08-11 Thread Duncan Murdoch
On 11/08/2011 3:11 PM, annie Zhang wrote: Hi All, I have a 2-dim density defined on 0 persp() or contour() are in the graphics package. There are similar ones in lattice (and I think in ggplot2), but I forget their names. There's also persp3d() in the rgl package for a rotatable version of

Re: [R] 2-dim density plot

2011-08-11 Thread R. Michael Weylandt
I'd suggest either a color plot as given by image() and related functions or a 3d mesh-plot which you can get from persp() E.g., x = seq(0,1,by=0.01); y = x z = outer(x,y+1,"/") # z = x/(y+1) -- I know that's not a density but you can adapt as necessary filled.contour(x,y,z) persp(x,y,z) There

[R] 2-dim density plot

2011-08-11 Thread annie Zhang
Hi All, I have a 2-dim density defined on 0https://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.