d1<-read.csv("/Users/koho0/Desktop/Noh.csv")
library(ggplot2)
cbp1 <- c("#00AFBB", "#FC4E07")
pd <- position_dodge(0.1)
ggplot(d1,aes(x=time_point,y=pip,colour=group))+
geom_line(position=pd)+
geom_errorbar(aes(ymin=pip-ci_interval,ymax=pip+ci_interval),width=0.3,position=pd)+
geom_point(aes(shape=group),position=pd,size = 3)+
scale_colour_manual(values=cbp1)+
coord_cartesian(xlim = c(0.3, 5.5), ylim = c(0,35))+
labs(y=expression(paste("Peak inspiratory pressure(cmH "[2],"O)")),x =expression(paste("Time point"))) +
theme_classic() +
theme(legend.position = c(0.8,0.9)) +
theme(legend.title = element_blank()) +
geom_hline(aes(yintercept=19.5),linetype="dashed", size=1, colour="#00AFBB")+
geom_hline(aes(yintercept=23.2),linetype="dashed", size=1, colour="#FC4E07")+
annotate("rect", xmin=c(0), xmax=c(6), ymin=c(17.9), ymax=c(21.1), alpha=0.2, fill="#00AFBB")+
annotate("rect", xmin=c(0), xmax=c(6), ymin=c(20.9), ymax=c(25.5), alpha=0.2, fill="#FC4E07")
