我是R新手。我正在绘制一条线的 4 近似值。我想把传说放在顶角。我试过了:
legend(
"topleft", legend=....)
然后我尝试手动设置位置仍然不起作用。下面是我的代码和我的情节:
plot(1:N, vRm, pch=".", col="blue", xlab="m", ylim=c(0.885, 0.91))
ylab="approximated 90th percentile")
lines(1:N, v1m, pch=".", col="yellow")
lines(1:N, v2m, pch=".", col="green")
lines(1:N, v3m, pch=".", col="red")
legend(
y=0.92, legend=c("quantile","90st", "91st",
"(90st+91st)/2"), col=c("blue", "yellow", "green", "red"), pch=c(".",".", ".", ".")
)
和情节:
如何将图例放在顶角?