ranking <- c(1,1,1,0,1,0,0,1,0,0)
x <- c(0,0,0,0,100,100,200,300,300,400,500)
y <- c(0,100,200,300,300,400,400,400,500,500,500)
h <- 500
w <- 500
grid.step <- 50
plot( c(0,w), c(0,h),
xaxs = "i",yaxs = "i",
xaxt = 'n', yaxt = 'n',
type = "n",
xlab = "Negatives", ylab = "Positives")
axis(2,y,labels=c('','p1','p2','p3','','p4','','','p5','',''))
axis(1,x,labels=c('','','','','n1','','n2','n3','','n4','n5'))
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
}
text( x[4]+10, y[4]-15, "A", col="red")
text( x[6]+10, y[6]-15, "B", col="red")
text( x[9]+10, y[9]-15, "C", col="red")
lines( x, y, lty=1, type='o')
segments(x[4],y[4],x[6],y[6],lty=3,col="red")
segments(x[6],y[6],x[9],y[9],lty=3,col="red")