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.
このプロットに直線形式 (5, 5) を無限大に追加するにはどうすればよいですか? 私は abline を使用していますが、5 から 5 の間の線は必要ありません。5 から無限大まで必要です。
x <- c(1:5); y <- x plot(x, y, type="l") abline(v= max(x), col="black", lwd=2, lty=2)
とを使用segmentsしpar('usr')て、既存の軸の範囲を抽出できます。私はlty=1それがプロット領域の端まで伸びることを示してきました
segments
par('usr')
lty=1
plot(x,y,type = 'l') segments(x0 = max(x), y0 = max(y), y1 = par('usr')[4], lwd=2)