[R] Very inaccurate circles

Gabor Grothendieck ggrothendieck at gmail.com
Tue Sep 8 04:44:43 CEST 2009


Try this:

library(plotrix)
plot(c(-5,0,0,5), c(0,5,-5,0), asp = 1)
draw.circle(0, 0, 5)


On Mon, Sep 7, 2009 at 7:58 PM, Juan Alonso<s at slnc.me> wrote:
> Hello,
>
> Please take a look at the attached plot and let me know if this is
> normal. The circle has radio  I am using R 2.9.2 inside OS X Leopard.
>
> The plot was generated with:
>
> png('bizarre_circle.png')
> plot(c(-5,0,0,5), c(0,5,-5,0))
> symbols(0,0, circles=c(sqrt(25)), inches=FALSE, add=TRUE)
> dev.off()
>
> If I resize the x11's plot window I can manage to make the circle pass
> through all the points but it's the first time I have to do this. I
> understand this may be happening because of the method to draw
> circles. I googled and found this other methods:
>
> http://tolstoy.newcastle.edu.au/R/help/03a/3364.html
>
> But method 2 and method 3 seem to use different units than my points
> and working with them is not so straightforward.
>
> 1. Is there a way to draw circles in the same unit system than plot
> already uses?
>
> 2. Is there a way of making method 3 (which uses mm) work with the
> same unit system as the plot?
>
> Thank you,
>
> --
> slnc
>
> ______________________________________________
> 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.
>
>




More information about the R-help mailing list