[R] R rectangle boundary question

Uwe Ligges ligges at statistik.uni-dortmund.de
Tue Nov 28 23:13:59 CET 2000



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.  

That's right, because you specified white (border=0) borders. From the
help:

 border: color for rectangle border(s).


Everything works using

 ...
 rect(0.1, 0.1, 0.9, 0.9, col="darkgreen", border="darkgreen" )
 rect(0.2, 0.2, 0.8, 0.8, col="yellow", border="yellow")
 ...
 
Regards,
Uwe Ligges


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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