edited figure script

This commit is contained in:
Ben Varick 2023-10-16 16:54:10 -05:00
parent 616f179f60
commit 85998c5c12
Signed by: ben
SSH Key Fingerprint: SHA256:jWnpFDAcacYM5aPFpYRqlsamlDyKNpSj3jj+k4ojtUo

View File

@ -7,7 +7,7 @@ ifelse(!dir.exists(file.path(getwd(), figure_dir)), dir.create(file.path(getwd()
# set colors
colors <- list(darkblue = "#062e57",
lightblue = "#b1dcf3")
lightblue = "#b1dcf3")
# set dimensions of figures
width <- 8.5
@ -19,41 +19,41 @@ margin <- 0
# plot map
plot_map <- function () {
plot(sf::st_geometry(extent_poly),
col = colors$darkblue,
border = "black")
plot(sf::st_geometry(data$NHDWaterbody),
col = colors$lightblue,
border = NA,
add = TRUE)
plot(sf::st_geometry(data$NHDArea),
col = colors$lightblue,
border = NA,
add = TRUE)
plot(sf::st_geometry(data$NHDFlowline),
col = colors$lightblue,
lwd = data$NHDFlowline$TotDASqKM^0.3204*0.0446,
border = NA,
add = TRUE)
plot(sf::st_geometry(extent_poly),
col = colors$darkblue,
border = "black")
plot(sf::st_geometry(data$NHDWaterbody),
col = colors$lightblue,
border = NA,
add = TRUE)
plot(sf::st_geometry(data$NHDArea),
col = colors$lightblue,
border = NA,
add = TRUE)
plot(sf::st_geometry(data$NHDFlowline),
col = colors$lightblue,
lwd = data$NHDFlowline$TotDASqKM^0.3204*0.0446,
border = NA,
add = TRUE)
}
# save figure
tiff(filename = paste0(figure_dir,"/map.tiff"),
width = width,
height = height,
units = units,
res = res,
compression = "lzw")
width = width,
height = height,
units = units,
res = res,
compression = "lzw")
par(mai=c(margin, margin, margin, margin))
par(mar=c(1,1,1,1))
plot_map()
dev.off()
png(filename = paste0(figure_dir, "/map.png"),
width = width,
height = height,
units = units,
res = res)
width = width,
height = height,
units = units,
res = res)
par(mai=c(margin, margin, margin, margin))
par(mar=c(1,1,1,1))
plot_map()