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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bizarre_circle.png
Type: image/png
Size: 22400 bytes
Desc: not available
URL:
<https://stat.ethz.ch/pipermail/r-help/attachments/20090907/d40e3ce2/attachment-0002.png>
On 8/09/2009, at 11:58 AM, Juan Alonso 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()<snip> Please don't post implied criticism of software (``very inaccurate'') when the fault lies not in the software but in your understanding. There is *nothing* inaccurate about the circles. The symbols() function is cleverly designed to produce ``circles'' that ***look*** like circles when plotted. In most cases they ***aren't*** circles, but rather ellipses, with eccentricity adjusted to compensate for the aspect ratio of the plot on which they are being superimposed. If you want the symbols()-created circle to pass through points which really do lie on a circle you need to make the aspect ratio of the plot equal to 1: plot(c(-5,0,0,5), c(0,5,-5,0),asp=1) symbols(0,0, circles=c(sqrt(25)), inches=FALSE, add=TRUE) OMMMMMMMMM! cheers, Rolf Turner ###################################################################### Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
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. > >
Reasonably Related Threads
- Convert matrix to numeric
- Programming Problem (for loop, random # control, 3 dimentional graph)
- How do I ensure that the polygon in spatstat::owin(poly=<polygon>) does not have “negative area”
- Asterisk13 don't execute h exten inside macros
- lpSolve: how to allow variables to become negative