Skip to content

Instantly share code, notes, and snippets.

@josephlewis
Created January 13, 2018 15:21
Show Gist options
  • Save josephlewis/11eb7f1e10000177d2717d4039fa5e9f to your computer and use it in GitHub Desktop.
Save josephlewis/11eb7f1e10000177d2717d4039fa5e9f to your computer and use it in GitHub Desktop.
ggplot(data = df.m, aes(x = month, group = 1)) +
geom_ribbon(data= subset(df.m, df.m$visits.raw > df.m$visits.mean), aes(ymin = pmin(visits.mean, visits.raw), ymax = pmax(visits.mean, visits.raw)),fill="#008FD5", alpha="0.2") +
geom_line(aes(y = visits.mean), size = 1.5, color = 'grey') +
geom_line(aes(y = visits.raw), size = 1.5, colour = "#008FD5") +
facet_wrap(~year, ncol = 3) +
scale_x_discrete(limits = month.abb) +
scale_y_continuous(labels=comma)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment