d1<-read.csv("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-sd,ymax=pip+sd),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_bw() + 
  theme(plot.background = element_blank(),
        panel.grid.major = element_blank(),
        panel.grid.minor = element_blank() )+
  theme(axis.line.x = element_line(color="black", size = 0.5),
        axis.line.y = element_line(color="black", size = 0.5)) +
  theme(legend.position = "top") +
  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(15.4), ymax=c(23.6), alpha=0.2, fill="#00AFBB")+
  annotate("rect", xmin=c(0), xmax=c(6), ymin=c(17.2), ymax=c(29.2), alpha=0.2, fill="#FC4E07")