the*_*ail 12
使用inset=选项legend
插图:当按关键字放置图例时,边距的插入距离(作为绘图区域的一部分).
例如:
plot(1:10)
legend("topleft","blah",inset=0.05)
Run Code Online (Sandbox Code Playgroud)
如果你想确保图例与角落的距离相同,取决于你的情节的x:y比例,你可以做一些更复杂的事情,如:
plot(1:10)
xyratio <- do.call("/",as.list(par("pin")))
inset.amount <- 0.05
legend("topleft","blah",inset=c(inset.amount,inset.amount * xyratio))
Run Code Online (Sandbox Code Playgroud)
当您调整绘图设备的大小时,这将会崩溃.

| 归档时间: |
|
| 查看次数: |
3059 次 |
| 最近记录: |