Eyrún að biðja ástina um aðstoð part 1

mjá
mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.6 kB
2
Indexable
Never
CH4_averages <- ggplot(data = frame20192020CH4, aes(x=date2, y=rowmeanCH4))+ theme_classic() +
  geom_ribbon(data=subset(frame20192020CH4, as.Date("2019-07-01", "%Y-%m-%d") <= date2 & date2 <= as.Date("2020-06-30", "%Y-%m-%d")), 
              aes(ymin=sd_minus,ymax=sd_plus), fill="gray", alpha=0.5) +
  geom_line(data = frame20192020CH4,mapping = aes(x = date2, y = rowmeanCH4), size = 1.5, color = "aquamarine3", alpha = 0.8, shape = 15, fill = "white") +
  geom_line(data = frame20192020CH4,mapping = aes(x = date2, y = rowmeanCH4_all), size = 1, color = "black", alpha = 0.8) +
  geom_line(data = frame20192020CH4,mapping = aes(x = date2, y = sd_plus), size = 1, color = "azure3", alpha = 0.5) +
  geom_line(data = frame20192020CH4,mapping = aes(x = date2, y = sd_minus), size = 1, color = "azure3", alpha = 0.5) +
  labs(y=expression("CH"[4]),#subtitle = 'MPI',
       x=expression("Month")) + theme( axis.text=element_text(size=15)) + theme(plot.margin = unit(c(1,1,1,1), "lines")) +
  theme(text=element_text(size=15),axis.text.x = element_text(size = 15), axis.text.y = element_text(size = 15))+   #+ geom_abline(slope = 1)
  theme(plot.margin = unit(c(1,1,1,1), "lines")) + ggtitle("CH4 concentrations, PPM") #+ geom_segment(aes(x = min_x, y = min_y,xend = max_x, yend = max_y)) #+ geom_segment(aes(x = min_x, y = min_y,xend = max_x, yend = max_y))


CH4_averages <- CH4_averages + scale_y_continuous(breaks = seq(1.85, 2.05, by= 0.05), limits = c(1.85, 2.05)) + scale_x_date(date_breaks = '1 month',expand = c(0,0),labels = date_format("%b"))