# # Script ciPlot.txt for doing the confidence interval plots that # I wanted. # library(ggplot2) cidf <- dget("egDat.txt") cidf.a <- cidf[cidf$param=="alpha",] cidf.b <- cidf[cidf$param=="beta",] Ylab.a <- expression(paste("Bias in ",alpha)) Ylab.b <- expression(paste("Bias in ",beta)) Part.a <- ggplot(cidf.a, aes(Ndat, estimate)) + geom_errorbar(aes(ymin = lower, ymax = upper), width = 50) + geom_point(size = 1) + geom_hline(yintercept = 0,col="red") + labs(x="",y=Ylab.a) + theme_bw() + theme(axis.title.x=element_text(size=14), axis.title.y=element_text(size=14)) + theme(axis.text.x=element_text(size=14), axis.text.y=element_text(size=14)) + theme(panel.border=element_rect(linetype="solid",fill=NA), panel.grid.minor=element_blank(), panel.grid.major=element_blank()) Part.b <- ggplot(cidf.b, aes(Ndat, estimate)) + geom_errorbar(aes(ymin = lower, ymax = upper), width = 50) + geom_point(size = 1) + geom_hline(yintercept = 0,col="red") + labs(x="Sample size",y=Ylab.b) + theme_bw() + theme(axis.title.x=element_text(size=14), axis.title.y=element_text(size=14)) + theme(axis.text.x=element_text(size=14), axis.text.y=element_text(size=14)) + theme(panel.border=element_rect(linetype="solid",fill=NA), panel.grid.minor=element_blank(), panel.grid.major=element_blank()) ciPlot <- cowplot::plot_grid(Part.a,Part.b,nrow=2) print(ciPlot)