4.5 Path

Path right

Code
x <- c(0,0,0,0,100)
y <- c(0,100,200,300,300)

h <- 300
w <- 100

grid.step <- 100

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',''))
axis(1,x,labels=c('','','','','n1'))

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[2]+10, y[2], "A")
text( x[3]+10, y[3], "B")
text( x[4]+10, y[4]-10, "C,D")
text( x[5]-10, y[5]-10, "E,F")

lines( x, y, lwd=5, type='o')

Path left

Code
graph TD;
    1["A: Length=3 & Gills=no & Beak=yes & Teeth=many"]:::filled
    2["B: Length=[3,4] & Gills=no & Beak=yes & Teeth=many"]
    10["C: Length=[3,4] & Gills=no & Beak=yes"]
    15["E: Beak=yes"]
    16["F: true"]
    19["D: Length=[3,4] & Beak=yes"]

    2 --> 1
    10 --> 2
    16 --> 15
    15 --> 19
    19 --> 10

    classDef filled fill:#f0f0f0,stroke:#000,stroke-width:1px;
graph TD;
    1["A: Length=3 & Gills=no & Beak=yes & Teeth=many"]:::filled
    2["B: Length=[3,4] & Gills=no & Beak=yes & Teeth=many"]
    10["C: Length=[3,4] & Gills=no & Beak=yes"]
    15["E: Beak=yes"]
    16["F: true"]
    19["D: Length=[3,4] & Beak=yes"]

    2 --> 1
    10 --> 2
    16 --> 15
    15 --> 19
    19 --> 10

    classDef filled fill:#f0f0f0,stroke:#000,stroke-width:1px;