ranking <- c(1, 1, 1, 0, 1, 0, 0, 1, 0, 0)
x <- c(0, 0, 0, 300, 300, 300, 600, 600, 600, 900, 1200)
y <- c(0, 200, 400, 400, 600, 800, 800, 1000, 1200, 1200, 1200)
h <- 1200
w <- 1200
grid.step <- 120
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(1, at = x, labels = c('', '', '', '0.25', '', '', '0.50', '', '', '0.75', '1.00'))
axis(2, at = y, labels = c('', '0.17', '0.33', '', '0.50', '0.67', '', '0.83', '1.00', '', ''))
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
}
lines(x, y, lty = 1, type = 'o')
segments(x[3], y[3], x[9], y[9], lty = 3, col = "red")
segments(x[1], y[6], x[9], y[9], lty = 3, col = "red")
abline(a = 1200, b = -h / w, lty = 3, col = "blue")
segments(0, 960, 240, 960, lty = 3, col = "blue")
segments(0, 12000 / 14, 4800 / 14, 12000 / 14, lty = 3, col = "blue")