[R] line thickness in plots

Paul Murrell p.murrell at auckland.ac.nz
Fri Sep 6 01:03:27 CEST 2002


Hi


"Liaw, Andy" wrote:
> 
> Try box(lwd=whatever).
> 
> However, for really large values of lwd (say 5, or even 15), the lines do
> not extend to the outer edge, so you see "notches".  Don't know how to solve
> that.


I _think_ what you are seeing there (the "notches") may be just the
choice of line-join style and/or line-cap style.  When lines get thick,
how to draw the end of a line (the cap) or how to draw joins between two
lines becomes an issue.  There are usually several options to choose
from and the one that R chooses (on the devices I've just looked at) is
to draw the ends and joins "rounded".  Possibly the best way to see this
is to look at the following output:

postscript()
plot(1:10)
box(lwd=10)
lines(c(2, 4), c(3, 3), lwd=10)
dev.off()

Notice that the ends of the line on its own are rounded and the corners
on the box around the outside are also rounded.  On screen this can look
less smooth just cos its dealing with pixels.  Hence the notches (I
think).

I'm afraid that's only an excuse rather than a solution :)

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