diff --git a/R/00-palette.R b/R/00-palette.R new file mode 100644 index 0000000..909c70b --- /dev/null +++ b/R/00-palette.R @@ -0,0 +1,12 @@ +### Palette - Study area figure ==== +# Alec Robitaille + +watercol <- '#c3e2ec' +islandcol <- '#d0c2a9' +coastcol <- '#82796a' +roadcol <- '#666666' +gridcol <- '#323232' + +parkcol <- '#9fb5a0' +parkboundcol <- '#4c5d3a' + diff --git a/R/02-fogo-island-figure.R b/R/02-fogo-island-figure.R index dfee56c..dc41036 100644 --- a/R/02-fogo-island-figure.R +++ b/R/02-fogo-island-figure.R @@ -21,12 +21,7 @@ utm <- st_crs('+proj=utm +zone=21 ellps=WGS84') ### Theme ---- # Colors -watercol <- '#c3e2ec' -islandcol <- '#d0c2a9' -coastcol <- '#82796a' -roadcol <- '#666666' -gridcol <- '#323232' - +source('R/00-palette.R') roadcols <- data.table(highway = c("primary", "secondary", "residential", "service", "unclassified", "footway")) diff --git a/R/04-newfoundland-figure.R b/R/04-newfoundland-figure.R index 03d3b8b..7653267 100644 --- a/R/04-newfoundland-figure.R +++ b/R/04-newfoundland-figure.R @@ -20,9 +20,7 @@ utm <- st_crs('+proj=utm +zone=21 ellps=WGS84') ### Theme ---- # Colors -watercol <- '#c3e2ec' -islandcol <- '#d0c2a9' -coastcol <- '#82796a' +source('R/00-palette.R') # Theme themeMap <- theme(panel.border = element_rect(size = 1, fill = NA), diff --git a/R/05-fogo-inset-newfoundland-figure.R b/R/05-fogo-inset-newfoundland-figure.R index e695c9b..331438f 100644 --- a/R/05-fogo-inset-newfoundland-figure.R +++ b/R/05-fogo-inset-newfoundland-figure.R @@ -40,12 +40,7 @@ utmBB <- data.table(dtbb[, project(cbind(x, y), utm$proj4string)]) ### Theme ---- # Colors -watercol <- '#c3e2ec' -islandcol <- '#d0c2a9' -coastcol <- '#82796a' -roadcol <- '#666666' -gridcol <- '#323232' - +source('R/00-palette.R') roadcols <- data.table(highway = c("primary", "secondary", "residential", "service", "unclassified", "footway")) diff --git a/R/07-terra-nova-figure.R b/R/07-terra-nova-figure.R index 2617079..0bbeb6b 100644 --- a/R/07-terra-nova-figure.R +++ b/R/07-terra-nova-figure.R @@ -29,14 +29,7 @@ highway <- roads[roads$highway %in% selroads,] ### Theme ---- # Colors -watercol <- '#c3e2ec' -islandcol <- '#d0c2a9' -coastcol <- '#82796a' -roadcol <- '#666666' -gridcol <- '#323232' - -parkcol <- '#9fb5a0' -parkboundcol <- '#4c5d3a' +source('R/00-palette.R') roadcols <- data.table(highway = selroads) roadcols[, cols := gray.colors(.N, start = 0.1, end = 0.4)] diff --git a/R/08-terra-nova-buns-figure.R b/R/08-terra-nova-buns-figure.R index 8a683c9..8bf5035 100644 --- a/R/08-terra-nova-buns-figure.R +++ b/R/08-terra-nova-buns-figure.R @@ -51,14 +51,7 @@ highway <- roads[roads$highway %in% selroads,] ### Theme ---- # Colors -watercol <- '#c3e2ec' -islandcol <- '#d0c2a9' -coastcol <- '#82796a' -roadcol <- '#666666' -gridcol <- '#323232' - -parkcol <- '#9fb5a0' -parkboundcol <- '#4c5d3a' +source('R/00-palette.R') roadcols <- data.table(highway = selroads) roadcols[, cols := gray.colors(.N, start = 0.1, end = 0.4)] diff --git a/graphics/04-newfoundland.png b/graphics/04-newfoundland.png index 4ce45a2..a62e804 100644 Binary files a/graphics/04-newfoundland.png and b/graphics/04-newfoundland.png differ diff --git a/graphics/05-fogo-inset-nl.png b/graphics/05-fogo-inset-nl.png index f49bcb6..c598b92 100644 Binary files a/graphics/05-fogo-inset-nl.png and b/graphics/05-fogo-inset-nl.png differ diff --git a/graphics/08-terra-nova-buns.png b/graphics/08-terra-nova-buns.png index c8e7ce0..2fb772d 100644 Binary files a/graphics/08-terra-nova-buns.png and b/graphics/08-terra-nova-buns.png differ diff --git a/run-figures.sh b/run-figures.sh new file mode 100755 index 0000000..fef8111 --- /dev/null +++ b/run-figures.sh @@ -0,0 +1,6 @@ +#!/bin/bash +for fig in R/*figure.R ; do + echo "Now running $fig" + Rscript $fig +done +rm Rplots.pdf