Dear Ying,

A simple way to obtain what you want is the following:

1) Select an x-y mesh where you want to plot the function, using

xs<-seq(xmin,xmax,length.xs)
ys<-seq(xmin,xmax,length.ys)

2) Define f as a function of (x,y) and compute the values of f over the x-y mesh, by using

zs<-outer(xs,ys,FUN=f)

3) Draw a contour plot at level 0:

contours(xs,ys,zs,levels=0,drawpoints=FALSE)

Hope it helped.
	[[alternative HTML version deleted]]


