There are easy ways to make axis breaks/gap plots. Is there a similarly simple way to make a axis break/gap plot with error bars? (I know only fiddly ways)
# install.packages("plotrix", dependencies = TRUE)
require(plotrix)
x <- c(1:20); y <- c(rnorm(10)+4, rnorm(10)+20)
gap.plot(x,y, gap=c(8,16), ytics=c(1:8,16:25))
errorbars <- function(x, y, err, width){
x0 = x; y0 = (y-err)
x1 = x; y1 = (y+err)
arrows(x0, y0, x1, y1, code=3, angle=90, length=width)
}
err <- rep(1,20)
plot(x,y)
errorbars(x,y,err,0.05)