h <- 50
w <- 50
grid.step <- 10
tpr1 <- 30
fpr1 <- 10
tpr2 <- 20
fpr2 <- 20
tpr3 <- 40
fpr3 <- 20
plot( c(0,w), c(0,h),
xaxs = "i",yaxs = "i",
xaxt = 'n', yaxt = 'n',
type = "n",
xlab = "False positive rate", ylab = "True positive rate")
axis(2,c(0,tpr2,tpr1,tpr3,h),labels=c('0','tpr2','tpr1','tpr3','1'))
axis(1,c(0,fpr1,fpr2,w),labels=c('0','fpr1','fpr2-3','1'))
gx <- grid.step
while (gx <= w) {
abline(v = gx, col="gray", lty="dotted")
gx <- gx + grid.step
}
gy <- grid.step
while (gy <= h) {
abline(h = gy, col="gray", lty="dotted")
gy <- gy + grid.step
}
abline(c(tpr2,h/w),lty=2)
col1 <- "blue"
points( fpr1, tpr1, col=col1, type="o")
text( fpr1, tpr1, "C1", pos=3)
abline(h=tpr1, v=fpr1, col=col1, lty="dotted")
col2 <- "red"
points( fpr2, tpr2, col=col2, type="o")
text( fpr2, tpr2, "C2", pos=3)
abline(h=tpr2, v=fpr2, col=col2, lty="dotted")
col3 <- "green"
points( fpr3, tpr3, col=col3, type="o")
text( fpr3, tpr3, "C3", pos=3)
abline(h=tpr3, v=fpr3, col=col3, lty="dotted")