made it easier to save in multiple formats
This commit is contained in:
parent
3632dde9be
commit
356a949dde
@ -9,23 +9,8 @@ ifelse(!dir.exists(file.path(getwd(), figure_dir)), dir.create(file.path(getwd()
|
|||||||
colors <- list(darkblue = "#062e57",
|
colors <- list(darkblue = "#062e57",
|
||||||
lightblue = "#b1dcf3")
|
lightblue = "#b1dcf3")
|
||||||
|
|
||||||
|
|
||||||
# save figure
|
|
||||||
tiff(filename = paste0(figure_dir,"/map.tiff"),
|
|
||||||
width = 11,
|
|
||||||
height = 17,
|
|
||||||
units = "in",
|
|
||||||
res = 600,
|
|
||||||
compression = "lzw")
|
|
||||||
|
|
||||||
png(filename = paste0(figure_dir, "/map.png"),
|
|
||||||
width = 11,
|
|
||||||
height = 17,
|
|
||||||
units = "in",
|
|
||||||
res = 600)
|
|
||||||
|
|
||||||
# plot map
|
# plot map
|
||||||
|
plot_map <- function () {
|
||||||
plot(sf::st_geometry(extent_poly),
|
plot(sf::st_geometry(extent_poly),
|
||||||
col = colors$darkblue,
|
col = colors$darkblue,
|
||||||
extent = extent_bbox,
|
extent = extent_bbox,
|
||||||
@ -54,6 +39,22 @@ plot(sf::st_geometry(data$NHDFlowline),
|
|||||||
xlim = c(extent$longitude_min, extent$longitude_max),
|
xlim = c(extent$longitude_min, extent$longitude_max),
|
||||||
ylim = c(extent$latitude_min, extent$latitude_max),
|
ylim = c(extent$latitude_min, extent$latitude_max),
|
||||||
add = TRUE)
|
add = TRUE)
|
||||||
# finish saving figure
|
}
|
||||||
|
|
||||||
|
# save figure
|
||||||
|
tiff(filename = paste0(figure_dir,"/map.tiff"),
|
||||||
|
width = 11,
|
||||||
|
height = 17,
|
||||||
|
units = "in",
|
||||||
|
res = 600,
|
||||||
|
compression = "lzw")
|
||||||
|
plot_map()
|
||||||
dev.off()
|
dev.off()
|
||||||
|
|
||||||
|
png(filename = paste0(figure_dir, "/map.png"),
|
||||||
|
width = 11,
|
||||||
|
height = 17,
|
||||||
|
units = "in",
|
||||||
|
res = 600)
|
||||||
|
plot_map()
|
||||||
dev.off()
|
dev.off()
|
Loading…
x
Reference in New Issue
Block a user