I would like to draw a circle on a graph I am plotting in R and use the current plot's coordinate system. The most basic functionality I am looking for is the ability to plot a circle on an already existing graph by simply providing the xy coordinates for it's centre and the radius. I am also looking for a way to obtain x,y values of a point (of a circle) by specifying only the origin x,y the angle and radius. Please point me so such a library and perhaps some simple one line code. Allan.
Is this of any use? http://tolstoy.newcastle.edu.au/R/help/06/04/25821.html --- On Sat, 3/12/11, Allan Kamau <kamauallan at gmail.com> wrote:> From: Allan Kamau <kamauallan at gmail.com> > Subject: [R] Drawing a circle on an existing graph. > To: r-help at r-project.org > Received: Saturday, March 12, 2011, 3:08 AM > I would like to draw a circle on a > graph I am plotting in R and use > the current plot's coordinate system. > The most basic functionality I am looking for is the > ability to plot a > circle on an already existing graph by simply providing the > xy > coordinates for it's centre and the radius. > > I am also looking for a way to obtain x,y values of a point > (of a > circle) by specifying only the origin x,y the angle and > radius. > > Please point me so such a library and perhaps some simple > one line code. > > Allan. > > ______________________________________________ > R-help at 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. >
On Sat, Mar 12, 2011 at 3:08 AM, Allan Kamau <kamauallan at gmail.com> wrote:> I would like to draw a circle on a graph I am plotting in R and use > the current plot's coordinate system. > The most basic functionality I am looking for is the ability to plot a > circle on an already existing graph by simply providing the xy > coordinates for it's centre and the radius. > > I am also looking for a way to obtain x,y values of a point (of a > circle) by specifying only the origin x,y the angle and radius. > > Please point me so such a library and perhaps some simple one line code. >There is draw.circle in the plotrix package. Also cex can create varying sizes of circles: plot(1:10, cex = 1:10) -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com