使绘图 abline 线透明

Mor*_*itz 4 plot r colors line

我想使用函数 abline 绘制几条应该透明的线,但我被卡住了。

目前我有这个代码:

plot(x=NA, type="n", ylim=c(1, 9), xlim=c(1, 4), xlab="x-value",
 ylab="y-value", cex.axis = 1, cex.lab = 1)

for (i in 1:nrow(one_hundred_regressions)) {abline(coef=one_hundred_regressions[i,],
                                                col = "red")}
Run Code Online (Sandbox Code Playgroud)

G. *_*eck 5

使用将值adjustcolor更改alpha为您想要的任何透明度:

plot(1:10)
abline(v = 1:10, col = adjustcolor("red", alpha = 0.3))
Run Code Online (Sandbox Code Playgroud)

截屏