2011年4月3日 星期日

[R] 畫圖時把兩個座標軸的scale調成一樣

網路上看到的小技巧, 原文在
簡單來說, 就是在plot()中加入一個參數asp=1...
檢附上面連結的example如下, 有空再來研究...
---
x <- sample(10:200,40)
y <- sample(20:100,40)
windows(width = max(x),height = max(y))
plot(x,y)
# try:
plot(x, y, asp = 1)
# or, better:
library(MASS)
eqscplot(x,y)
#or
library(lattice)
xyplot(y ~ x, aspect = "iso")

沒有留言: