如何在位于绘图区域外的以下代码中添加图例。
这是可复制的代码:
任何建议都将不胜感激。谢谢!
par(pty="s")
library(ROCR)
data(ROCR.simple)
pred <- prediction( ROCR.simple$predictions, ROCR.simple$labels )
pred2 <- prediction(abs(ROCR.simple$predictions +
rnorm(length(ROCR.simple$predictions), 0, 0.1)),
ROCR.simple$labels)
perf <- performance(pred, "tpr", "fpr" )
perf2 <- performance(pred2, "tpr", "fpr")
# Plot pred 1
plot(perf, col="red")
# plot pred 2
plot(perf2, add = TRUE, col="blue")
任何建议都将不胜感激。谢谢!