From 79c16d3cc804ceae78cd6c4a43054494b8101db5 Mon Sep 17 00:00:00 2001 From: hrbrmstr Date: Mon, 11 Nov 2019 09:42:35 -0500 Subject: [PATCH] day 12 --- 2019-11-11-elevation.R | 3 ++- 2019-11-12-movement.R | 16 ++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/2019-11-11-elevation.R b/2019-11-11-elevation.R index 0711082..3de28d5 100644 --- a/2019-11-11-elevation.R +++ b/2019-11-11-elevation.R @@ -86,7 +86,7 @@ ggplot() + labs( x = NULL, y = NULL, title = "Mount Desert Island / Acadia National Park Elevation Contours", - caption = "Data source: {tigris}\nhttps://git.rud.is/hrbrmstr/y2019-30daymapchallenge • #30DayMapChallenge" + caption = "Data source: ArcGIS/\nhttps://git.rud.is/hrbrmstr/y2019-30daymapchallenge • #30DayMapChallenge" ) + theme_ipsum_es(grid="", plot_title_size = 24) + theme(plot.background = element_rect(fill = "#3a4f5b", color = "#3a4f5b")) + @@ -94,6 +94,7 @@ ggplot() + theme(legend.title = element_text(color = "white")) + theme(legend.text = element_text(color = "white")) + theme(plot.title = element_text(hjust = 0.5, color = "white")) + + theme(plot.caption = element_text(color = "white")) + theme(legend.position = c(0.9, 0.275)) diff --git a/2019-11-12-movement.R b/2019-11-12-movement.R index df04fad..f0b5453 100644 --- a/2019-11-12-movement.R +++ b/2019-11-12-movement.R @@ -47,7 +47,7 @@ select(cmap, fips, geometry) %>% select(fips, lng = X, lat = Y) -> centers count(me_start, start_county, wt=workers, sort=TRUE) %>% - mutate(lab = glue::glue("{gsub(' County', '', start_county)} Total Outflow: {scales::comma(n)}")) -> labs + mutate(lab = glue::glue("{gsub(' County', '', start_county)} Outflow: {scales::comma(n)}")) -> labs left_join( me_start, centers, @@ -61,8 +61,6 @@ left_join( mutate(lab = factor(lab, levels = labs$lab)) %>% glimpse() -> start -st_bbox(cmap) - ggplot() + geom_sf(data = cmap, color = "#b2b2b277", size = 0.05, fill = "#3B454A") + geom_curve( @@ -75,9 +73,15 @@ ggplot() + ) + scale_color_distiller( limits = range(start$workers), labels = scales::comma, - trans = "log10", palette = "Reds", direction = 1 + trans = "log10", palette = "Reds", direction = 1, name = "Worker\nOutflow" ) + coord_sf(datum = NA, ylim = c(-2500000.0, 1500000)) + facet_wrap(~lab) + - labs(x = NULL, y = NULL) + - theme_ft_rc(grid="") + labs( + x = NULL, y = NULL, + title = "Oh The Places [Mainers] Will Go [For Work]!", + subtitle = "2011-2015 5-Year ACS commuting outflows from Maine counties to out-of-state counties, sorted from most worker outflow to least.", + caption = "Data source: \nhttps://git.rud.is/hrbrmstr/y2019-30daymapchallenge • #30DayMapChallenge" + ) + + theme_ft_rc(grid="", strip_text_family = font_es_bold, strip_text_size = 13) + + theme(strip.text = element_text(color = "white"))