ggplot() +
theme_bw() +
geom_rect(data = sampling, aes(xmin = start, xmax = end, ymin = ymin, ymax = ymax), alpha = 0.3, fill = "red") +
geom_point(data = data, aes(x = date, y = avg_air_t), colour = "skyblue4", size = 2, shape = 21, fill = "white") +
stat_smooth(data = data, aes(x = date, y = avg_air_t), method = "loess", se = FALSE, colour = "skyblue4", linewidth = 1) +
geom_line(data = precip, aes(x = date, y = cumu_precip/12 -10), colour = "black") +
scale_y_continuous(name = expression("Daily Temperature " ( degree*C)),
sec.axis = sec_axis(~ (. + 10) * 12 , name = "Cumulative Precipitation (mm)"),
limits = c(-10, 30),
expand = c(0, 0)) +
scale_x_date(date_labels = "%b",
date_breaks = "1 month",
expand = c(0.05,0.05)) +
theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1),
axis.title.x = element_blank()) +
facet_wrap(~year, scale = "free_x")