Re: [R] question on contour function

2010-08-12 Thread ba ba
seq(-1,1,0.1) xy <- meshgrid(x,y) z <- xy$x^2+ 3*xy$y^2 z <- t(z) contour(x,y,z,col="blue",xlab="x",ylab="y") Of course, the first method is better since it only uses the base function. David Lee On 12 August 2010 01:54, David Winsemius wrote:

[R] question on contour function

2010-08-11 Thread ba ba
Dear All, I tried to plot contour lines using R function contour, but got the results which are not expected. require(RTOMO) x <- seq(-1,1,0.1) y <- seq(-1,1,0.1) xy <- meshgrid(x,y) z <- xy$x^2+ 3*xy$y^2 contour(x,y,z,col="blue",xlab="x",ylab="y") The above code gave me the contour graph for z