When i use segments()
to draw a segment using R, the ends always appear rounded. How can I change the ends to flat?
From ?par
:
‘lend’ The line end style. This can be specified as an integer or
string:
‘0’ and ‘"round"’ mean rounded line caps [_default_];
‘1’ and ‘"butt"’ mean butt line caps;
‘2’ and ‘"square"’ mean square line caps.
For example:
plot(0:1,0:1,type="n")
par(lend=0); segments(0,0.2,1,0.2,lwd=8)
par(lend=1); segments(0,0.4,1,0.4,lwd=8)
par(lend=2); segments(0,0.6,1,0.6,lwd=8)
or segments(0,0.2,1,0.2,lwd=8, lend=1)
etc.
(You have to look pretty carefully to see the difference, especially between "butt" and "square" caps)