[R] Drawing a circle on an existing graph.

Allan Kamau kamauallan at gmail.com
Sat Mar 12 16:56:52 CET 2011


> --- 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 5:28 PM, John Kane <jrkrideau at yahoo.ca> wrote:
> Is this of any use? http://tolstoy.newcastle.edu.au/R/help/06/04/25821.html
>

Thank you John, that is what I was looking for.
The code does draw a neat circle that is not stretched. After plotting
the circle on an existing plot I notice that the original plot was
indeed stretched somehow by approximately some 1:1.1 ratio (I think).
Now I am looking for a way to enforce none stretching in my original
graph.

Allan.



More information about the R-help mailing list