Re: [R] ggplot2 stat_density2d issue.

2012-04-18 Thread David Winsemius
On Apr 18, 2012, at 7:52 PM, Dmitriy Lyubimov wrote: Sorry. i forgot the lines with parameters for my multivariate normal simulation. here's the code for data simulation i used: === sigm1 <- diag(c(30,50)) sigm2 <- diag(c(5,3)) mu1 <- c(10,15) mu2 <- c(80,60) sample <- rou

Re: [R] ggplot2 stat_density2d issue.

2012-04-18 Thread Dmitriy Lyubimov
Sorry. i forgot the lines with parameters for my multivariate normal simulation. here's the code for data simulation i used: === sigm1 <- diag(c(30,50)) sigm2 <- diag(c(5,3)) mu1 <- c(10,15) mu2 <- c(80,60) sample <- round(rbind(rmvnorm(100,mu1,sigm1),rmvnorm(100,mu2,sigm2)))

Re: [R] ggplot2 stat_density2d issue.

2012-04-18 Thread Dmitriy Lyubimov
Thanks David. let's say sample data (two-modal multivariate normal simulation, needs mvtnorm package) = library(mvtnorm) sample <- round(rbind(rmvnorm(100,mu1,sigm1),rmvnorm(100,mu2,sigm2))) sample <- sample[! (sample[,1] <1 | sample[,2] <1 | sample[,1]> 100 | sample[,2]>

Re: [R] ggplot2 stat_density2d issue.

2012-04-18 Thread David Winsemius
On Apr 18, 2012, at 6:55 PM, Dmitriy Lyubimov wrote: Hello, I'd be very grateful for help with some ggplot2's stat_density2d issues. First issue is with data limits. xlim() and ylim() doesn't seem to work; instead, estimates (and plotting) seems to be constrained to range(x), range(y) no m

[R] ggplot2 stat_density2d issue.

2012-04-18 Thread Dmitriy Lyubimov
Hello, I'd be very grateful for help with some ggplot2's stat_density2d issues. First issue is with data limits. xlim() and ylim() doesn't seem to work; instead, estimates (and plotting) seems to be constrained to range(x), range(y) no matter what i do. The documentation says i can pass in kde2d'