# # Script demo # library(ggplot2) cim <- structure(list(estval = c(95.0598372177329, 65.9807415589531, 65.0869720623762, 53.33770184058, 50.072498670345, 38.409859732603), lower = c(61.0379367809246, 47.704518120524, 47.7668481532269, 40.888420637935, 39.2569699351463, 31.6204270540546), upper = c(252.642096309401, 111.943573713694, 106.932728282857, 78.6103902448028, 70.5796504724512, 49.3747630796037), Trt = structure(6:1, .Label = c("F", "E", "D", "C", "B", "A"), class = "factor")), row.names = c("A", "C", "B", "D", "E", "F"), class = "data.frame") xlim <- c(0,1.05*max(cim[,3])) mane <- "95% confidence intervals for LD values" ldCiPlot <- ggplot(cim) + geom_point(aes(y = estval, x = Trt), shape = 18, size = 3, colour="red") + geom_errorbar(aes(ymin = lower, ymax = upper, x = as.numeric(Trt)), width = 0.04*nrow(cim)) + labs(x = "", y = "TrtTime") + ylim(xlim[1],xlim[2]) + theme_bw() + theme(axis.text = element_text(size = 14), axis.title = element_text(size = 16)) + theme(plot.title = element_text(hjust = 0.5,face="bold")) + theme(plot.margin = unit(c(1,1,1,0.5),units="cm")) + ggtitle(mane) + coord_flip()