[R] Drawing a circle on an existing graph.

Gabor Grothendieck ggrothendieck at gmail.com
Sat Mar 12 15:39:58 CET 2011


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



More information about the R-help mailing list