[Rd] (PR#849)

Peter Dalgaard BSA p.dalgaard@pubhealth.ku.dk
15 Feb 2001 22:22:01 +0100


"Paul Murrell" <paul@stat.auckland.ac.nz> writes:

> Hi
> 
> 
> > The symbol( circle) function does not create
> > circles.
> >
> > See following function
> >
> > ijwbug <- function()
> > {
> >    plot.new()
> >      plot.window(c(-1,1),c(-1,1));
> >    symbols(0,0,circle=1,add=T,inches=F);
> >
> >    curve(sqrt(1 - x^2), from = -1, to = 1, add = T, lty = 1)
> >      curve(-sqrt(1 - x^2), from =  -1, to = 1, add = T, lty = 1)
> > lines(c(-1,1),c(1,1));
> > lines(c(-1,1),c(-1,-1));
> >
> >
> > }
> 
> 
> If I understand correctly, I think you're just seeing clipping.
> 
> Does the slight modification of your function given below behave as you
> would expect ?
> 
> ijwbug <- function()
> { 
>    # do not clip to figure region, clip only to device region
>    par(xpd=NA) 
>    plot.new()
>    plot.window(c(-1,1),c(-1,1));
>    symbols(0,0,circle=1,add=T,inches=F);
>    # I have added colour to the curves 
>    curve(sqrt(1 - x^2), from = -1, to = 1, add = T, lty = 1, col="red")
>    curve(-sqrt(1 - x^2), from =  -1, to = 1, add = T, lty = 1, col="red")
>    lines(c(-1,1),c(1,1));
>    lines(c(-1,1),c(-1,-1));
> }
> 
> Paul

Actually, I think the real problem is that the plotting region is not
square, so  curve(sqrt(1 - x^2),...) is an ellipse. Insert
par(pty="s") to fix that.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._