Dear friends, I was drawing a circle with centrum in (1,-1) and radius 5 to show my girl that the line y=3*x+1 goes through (1,4) and (-2,-5) of the circle, but on Windows XP, R 2.20 the drawing was not good at all, and the known solutions were not shown in the graph. I guess I got it wrong? Is this use not intended ? Best wishes Troels Ring, MD Aalborg, Denmark symbols(x=1,y=-1,circles=5,inches=FALSE, xlim=c(-10,10),ylim=c(-10,10)) curve(3*x+1,-10,10,1000,add=T) abline(v=c(-2,1)) abline(h=c(-1,-5,4))
drawing a circle using symbols
5 messages · Paul Murrell, Sundar Dorai-Raj, Brian Ripley +1 more
Hi
Troels Ring wrote:
Dear friends, I was drawing a circle with centrum in (1,-1) and radius 5 to show my girl that the line y=3*x+1 goes through (1,4) and (-2,-5) of the circle, but on Windows XP, R 2.20 the drawing was not good at all, and the known solutions were not shown in the graph. I guess I got it wrong? Is this use not intended ? Best wishes Troels Ring, MD Aalborg, Denmark symbols(x=1,y=-1,circles=5,inches=FALSE, xlim=c(-10,10),ylim=c(-10,10)) curve(3*x+1,-10,10,1000,add=T) abline(v=c(-2,1)) abline(h=c(-1,-5,4))
The important part may be that your plot is not square. In the help
file for symbols() it says (NOTE the "x axis") ...
inches: If 'inches' is 'FALSE', the units are taken to be those of
the x axis.
If you precede your code with ...
par(pty="s")
... does the result look better?
Paul
Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 paul at stat.auckland.ac.nz http://www.stat.auckland.ac.nz/~paul/
Troels Ring wrote:
Dear friends, I was drawing a circle with centrum in (1,-1) and radius 5 to show my girl that the line y=3*x+1 goes through (1,4) and (-2,-5) of the circle, but on Windows XP, R 2.20 the drawing was not good at all, and the known solutions were not shown in the graph. I guess I got it wrong? Is this use not intended ? Best wishes Troels Ring, MD Aalborg, Denmark symbols(x=1,y=-1,circles=5,inches=FALSE, xlim=c(-10,10),ylim=c(-10,10)) curve(3*x+1,-10,10,1000,add=T) abline(v=c(-2,1)) abline(h=c(-1,-5,4))
Hi, Troels,
The aspect ratio of y to x is not 1. So, the symbol is visually a circle
but in reality an ellipse. Try
symbols(x = 1, y = -1, circles = 5, inches = FALSE,
asp = 1, xlim = c(-10, 10), ylim = c(-10, 10))
curve(3 * x + 1, -10, 10, 1000, add = TRUE)
abline(v = c(-2, 1))
abline(h = c(-1, -5, 4))
HTH,
--sundar
?symbols says
inches: If 'inches' is 'FALSE', the units are taken to be those of
the x axis.
Note, 'the x axis' and you have not ensured the x and y axes have the same
scale. Try
plot(c(-10,10), c(-10,10), asp=1, type="n")
symbols(x=1,y=-1,circles=5,inches=FALSE, add=TRUE
curve(3*x+1,-10,10,1000,add=TRUE)
abline(v=c(-2,1))
abline(h=c(-1,-5,4))
which works for me. (eqscplot in MASS is another way to do this.)
On Tue, 29 Nov 2005, Troels Ring wrote:
Dear friends, I was drawing a circle with centrum in (1,-1) and radius 5 to show my girl that the line y=3*x+1 goes through (1,4) and (-2,-5) of the circle, but on Windows XP, R 2.20 the drawing was not good at all, and the known solutions were not shown in the graph. I guess I got it wrong? Is this use not intended ? Best wishes Troels Ring, MD Aalborg, Denmark symbols(x=1,y=-1,circles=5,inches=FALSE, xlim=c(-10,10),ylim=c(-10,10)) curve(3*x+1,-10,10,1000,add=T) abline(v=c(-2,1)) abline(h=c(-1,-5,4))
______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Thanks a lot, Paul! Best wishes Troels
At 20:05 29-11-2005, you wrote:
Hi Troels Ring wrote:
Dear friends, I was drawing a circle with centrum in (1,-1) and radius 5 to show my girl that the line y=3*x+1 goes through (1,4) and (-2,-5) of the circle, but on Windows XP, R 2.20 the drawing was not good at all, and the known solutions were not shown in the graph. I guess I got it wrong? Is this use not intended ? Best wishes Troels Ring, MD Aalborg, Denmark symbols(x=1,y=-1,circles=5,inches=FALSE, xlim=c(-10,10),ylim=c(-10,10)) curve(3*x+1,-10,10,1000,add=T) abline(v=c(-2,1)) abline(h=c(-1,-5,4))
The important part may be that your plot is not square. In the
help file for symbols() it says (NOTE the "x axis") ...
inches: If 'inches' is 'FALSE', the units are taken to be those of
the x axis.
If you precede your code with ...
par(pty="s")
... does the result look better?
Paul
--
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
paul at stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~paul/