当我使用segments()
使用R绘制线段时,末端始终显示为圆形。如何将两端更改为扁平?
答案 0 :(得分:14)
来自?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.
例如:
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)
或segments(0,0.2,1,0.2,lwd=8, lend=1)
等
(你必须仔细看看差异,特别是“屁股”和“方形”帽之间的差异)