R语言中abline函数

 

1、

plot(0:10, 0:10, pch = 16, col = "red", xaxs = "i", yaxs = "i")
abline(h = 5, lwd = 5)     ## 高度

 

 

2、

plot(0:10, 0:10, pch = 16, col = "red", xaxs = "i", yaxs = "i")
abline(v = 5, lwd = 5)     ## 水平

 

 

3、

plot(0:10, 0:10, pch = 16, col = "red", xaxs = "i", yaxs = "i")
abline(a = 1, b = 2, lwd = 5)      ## y = a + bx

 

posted @ 2022-05-17 23:54  小鲨鱼2018  阅读(647)  评论(0编辑  收藏  举报