[R] Is something wrong wiht draw.circle()?
Jim Lemon
jim at bitwrit.com.au
Sat Sep 8 09:44:08 CEST 2012
On 09/08/2012 02:04 AM, Chris82 wrote:
> Hey R users,
>
> I am a little bit confused.
>
>
> require(plotrix)
>
> plot(0,xlim=c(-10,10),ylim=c(-10,10),type="n",xlab="",ylab="")
> draw.circle(0,0,5)
>
> lines(c(0,0),c(0,5))
> lines(c(0,5),c(0,0))
>
>
> This is not really a circle with a radius of 5.
>
Hi Chris82,
If you measure it, you will find that it is indeed a circle, and that
your two "radii" are not of equal length (see Euclid, -300). The
draw.circle function attempts to correct for the aspect ratio of the
plot, but not for the aspect ratio of the device, so there may be slight
variations on different devices.
Jim
More information about the R-help
mailing list