Skip to content

Commit

Permalink
update zonal plots
Browse files Browse the repository at this point in the history
  • Loading branch information
David March authored and David March committed Jan 7, 2021
1 parent af35ac7 commit d33acb3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions analysis/ais-global/05a_zonal_dist2coast_temporal.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ library(parallel)
library(dplyr)
library(ggplot2)
library(egg)

library(raster)



Expand All @@ -30,11 +30,11 @@ vars <- c("COUNT", "FISHING", "PASSENGER", "CARGO", "TANKER", "OTHER")

# set dates
dates_post <- c(
seq.Date(as.Date("2020-01-01"), as.Date("2020-07-01"), by = "month")
seq.Date(as.Date("2020-01-01"), as.Date("2020-06-01"), by = "month")
) %>% format("%Y%m%d")

dates_pre <- c(
seq.Date(as.Date("2019-01-01"), as.Date("2019-07-01"), by = "month")
seq.Date(as.Date("2019-01-01"), as.Date("2019-06-01"), by = "month")
) %>% format("%Y%m%d")


Expand Down Expand Up @@ -124,7 +124,7 @@ for (j in 1:length(vars)){
}


data <- rbindlist(data_list)
data <- data.table::rbindlist(data_list)


#------------------------------------------------
Expand Down Expand Up @@ -152,7 +152,7 @@ p <- ggplot(filter(data, dcoast <= 4800), aes(x = dcoast, group = var)) +
geom_hline(yintercept = 0, linetype="dotted") +
geom_line(aes(y = mean), colour="#3182bd", size = 0.5) +
scale_colour_brewer(palette="Set2") +
ylab(expression(Traffic~density~change~(Delta~vessels/km^2))) + xlab("Distance to coast (km)") +
ylab(expression(Traffic~density~change~(Delta~vessel~transits/km^2))) + xlab("Distance to coast (km)") +
facet_wrap(var ~ ., ncol = 1) +
ylim(-0.03, 0.01) +
theme_article() +
Expand Down
10 changes: 5 additions & 5 deletions analysis/ais-global/05b_zonal_latitude_temporal.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ library(parallel)
library(dplyr)
library(ggplot2)
library(egg)

library(raster)

# set input directory
input_dir <- "data/out/ais-global/delta/"
Expand All @@ -28,11 +28,11 @@ vars <- c("COUNT", "FISHING", "PASSENGER", "CARGO", "TANKER", "OTHER")

# set dates
dates_post <- c(
seq.Date(as.Date("2020-01-01"), as.Date("2020-07-01"), by = "month")
seq.Date(as.Date("2020-01-01"), as.Date("2020-06-01"), by = "month")
) %>% format("%Y%m%d")

dates_pre <- c(
seq.Date(as.Date("2019-01-01"), as.Date("2019-07-01"), by = "month")
seq.Date(as.Date("2019-01-01"), as.Date("2019-06-01"), by = "month")
) %>% format("%Y%m%d")


Expand Down Expand Up @@ -78,7 +78,7 @@ for (j in 1:length(vars)){
}
}

data <- rbindlist(data_list)
data <- data.table::rbindlist(data_list)


#------------------------------------------------
Expand All @@ -103,7 +103,7 @@ p <- ggplot(filter(data, latitude > -70 & latitude < 70), aes(x = latitude)) + #
geom_hline(yintercept = 0, linetype="dotted") +
geom_line(aes(y = mean), colour="#3182bd", size = 0.5) + # colour="#3182bd",
scale_colour_brewer(palette = "Blues") +
ylab(expression(Traffic~density~change~(Delta~vessels/km^2))) + xlab("Latitude") +
ylab(expression(Traffic~density~change~(Delta~vessel~transits/km^2))) + xlab("Latitude") +
ylim(-0.03, 0.01) +
facet_wrap(var ~ ., ncol = 1) +
theme_article() +
Expand Down

0 comments on commit d33acb3

Please sign in to comment.