Here is a solution using contour: x <- y <- seq(-1.5,1.5,length=100) z <- outer(x, y, function(x,y) x^2+y^2)
contour(x,y,z, levels=1) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of . . > Sent: Sunday, February 20, 2011 2:41 AM > To: r-help@r-project.org > Subject: [R] Plot of set > > > I am in the situation where I have to make a two-dimential plot of a > set. If I simplify my data it would be something along the lines of > wanting to plot {x,y| x^2+y^2 < = 1}. > I am aware of the contour and persp plot, but cannot figure out how to > convert one of those to draw the set. I have tried to google different > ways of plotting in R but have not been able to find a method through > that either. > > Thanks in advance > > Lise > [[alternative HTML version deleted]] > > ______________________________________________ > 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. ______________________________________________ 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.