Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们如何在任何给定的坐标范围内绘制对角线(从左下角到右上角)?
例如
> plot(c(-2,3), c(-1,5), type = "n", xlab="x", ylab="y", asp = 1)
或者
> plot(c(0,1000), c(0,334), type = "n", xlab="x", ylab="y", asp = 1)
我尝试了以下操作但失败了:
> abline(0,1,col="red")
当前绘图区域的范围在par()$usr.
par()$usr
lines( par()$usr[1:2], par()$usr[3:4] )