At the base of R ...
plot(pos, type = 'n', xlim = range(c(start, end)), ylim = c(13,0)) grid() segments(start, pos, end, pos)
To get it more accurately, like your figure ...
r <- par('usr') plot(pos, type = 'n', xlim = range(c(start, end)), ylim = c(13.5,0.5), xlab = '', xaxt = 'n', yaxt = 'n', panel.first = rect(r[1], r[3], r[2], r[4], col = 'goldenrod')) # abline(h = 1:13, col = 'white') # abline(v = 1:13, col = 'white') grid(lty = 1, col = 'white') axis(1, 1:13, 1:13, cex.axis = 0.8) axis(2, 1:13, 1:13, las = 1, cex.axis = 0.8) segments(start, pos + 0.5, end, pos + 0.5, lwd = 2)
source share