[R] R rectangle boundary question

ben@zoo.ufl.edu ben at zoo.ufl.edu
Wed Nov 29 01:03:24 CET 2000


 You want to use "lwd=0" rather than "border=0".  "border" sets the border
_color_, not its width (and border=0, I believe, sets the border to the
current background color, white in this case).
  A more careful reading of ?rect would have detected this ...

  Ben Bolker

On Tue, 28 Nov 2000, Janos A. Csirik wrote:

> Hello,
>
> I am trying to produce two rectangles in R that are immediately adjacent
> to each other.  However, I always seem to get a white boundary around each
> rectangle, even though I have border=0.  Can anyone tell me how to get rid
> of that boundary?  Thanks!
>
> Here is a script of minimal length that illustrates my problem:
> -------------------------------------------------------------------
> postscript ( "out.ps", paper="letter" )
> par(mar=rep(0,4))
> plot(c(0,1), c(0,1), type="n", xaxs="i", yaxs="i", bty="n")
> rect ( 0,0,1,1, col="white", border=0 )
> rect ( 0.1, 0.1, 0.9, 0.9, col="darkgreen", border=0 )
> rect ( 0.2, 0.2, 0.8, 0.8, col="yellow", border=0 )
> dev.off()
> -------------------------------------------------------------------
>
> If you look at the output, you see that the yellow rectangle is surrounded
> by a tiny white boundary, instead of the color going immediately from
> yellow to green.
>
> Please send a copy of your reply to janos at research.att.com
>
> Thanks again,
>
> Janos A Csirik
>
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help 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-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-- 
318 Carr Hall                                bolker at zoo.ufl.edu
Zoology Department, University of Florida    http://www.zoo.ufl.edu/bolker
Box 118525                                   (ph)  352-392-5697
Gainesville, FL 32611-8525                   (fax) 352-392-3704

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list