-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathracc_unbalanced_right.qmd
65 lines (51 loc) · 1.19 KB
/
racc_unbalanced_right.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
title: "Racc unbalanced right"
---
```{r}
#| echo: false
h <- 500 # height of plot
w <- 500 # width of plot
# w <- 360 # width of plot
grid.step <- 50
# print to a file
# png(height = h, width = w, filename = "pn-nested.png")
# windows(height = h, width = w)
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")
x <- c(0, 50, 100, 500)
y <- c(0, 200, 300, 500)
# draw axes
axis(2,y,labels=c('0','tpr1','tpr2','1'))
axis(1,x,labels=c('0','fpr1','fpr2','1'))
# add a grid
# grid seems to be buggy
#grid (nx = w/grid.step, ny = h/grid.step)
gx <- grid.step/2
while (gx <= w) {
abline(v = gx, col="gray", lty="dotted")
gx <- gx + grid.step/2
}
gy <- grid.step
while (gy <= h) {
abline(h = gy, col="gray", lty="dotted")
gy <- gy + grid.step
}
# draw diagonal
# abline(c(0,h/w),lty=3)
# label the points
#text( x[1]+10, y[1]+10, "A")
#text( x[2:3]+10, y[2:3], labels=c("B","C"))
#text( x[4]-10, y[4]-15, "D")
# now draw nested grids
for (i in 2:3) {
abline(v=x[i],lty='dashed')
abline(h=y[i],lty='dashed')
}
# draw curve
lines( x, y, lty=1, type='o')
# close file
#dev.off()
```