1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| p <-ggplot(Glob, aes(x=Date, y= Molécule)) +
geom_rect(aes(xmin=as.Date(c('03/10/2019'),format="%d/%m/%Y"),xmax=as.Date(c('17/10/2019'),format="%d/%m/%Y"), ymin = -Inf, ymax = Inf),fill="Black", subset (Glob, Periode=="Periode1"))+
geom_rect(aes(xmin=as.Date(c('17/10/2019'),format="%d/%m/%Y"),xmax=as.Date(c('31/01/2020'),format="%d/%m/%Y"), ymin = -Inf, ymax = Inf),fill="#F2F2F2", subset (Glob, Periode=="Periode1")) +
geom_rect(aes(xmin=as.Date(c('01/02/2019'),format="%d/%m/%Y"),xmax=as.Date(c('28/03/2019'),format="%d/%m/%Y"), ymin = -Inf, ymax = Inf),fill="#F2F2F2", subset (Glob, Periode=="Periode2")) +
geom_rect(aes(xmin=as.Date(c('20/09/2019'),format="%d/%m/%Y"),xmax=as.Date(c('26/09/2019'),format="%d/%m/%Y"), ymin = -Inf, ymax = Inf),fill="#F2F2F2", subset (Glob, Periode=="Periode2")) +
geom_step(aes(), na.rm = TRUE, size=0.4)+
scale_x_date(date_breaks = "1 months" ,labels = date_format("%b"),limit=c(as.Date("2019-02-01"),as.Date("2020-01-31"))) +
scale_y_continuous(labels = number_format(accuracy = 0.01,decimal.mark = ','))+
theme_bw()+
ylab(expression(paste("nom molécule ","(µg.l"^{ -1},")")))+
facet_grid(Code_Station ~Periode , scale="free")+
geom_line(y = 0.1, color="orange", linetype = "dashed", size=0.6) +
geom_line(y = 2, color="red",linetype = "dashed", size=0.6)+
geom_point(aes(x=Date_ODE),color="#002060", na.rm = TRUE, size=3, shape=20)+
theme(axis.title.x = element_blank(),axis.title.y = element_text(size=10, color="#52657E"),strip.background = element_rect(fill="#52657E"),axis.text.x = element_text( angle=50, hjust=1, vjust=1.2, size=7.5, color="#52657E"), strip.text.y = element_text( size = 10, color = "white" ), strip.background.x = element_blank(), strip.text.x=element_blank(),axis.text.y = element_text( hjust=0, vjust=0.5, size=8, color="#52657E"),panel.spacing = unit(0.5, "lines"))
#geom_point(aes(x=Date_ODE, y=Chlordecone_ODE), na.rm = TRUE)
P |
Partager