library(tidyverse)
library(sf)
library(rnaturalearth)
library(rnaturalearthdata)
library(showtext)
font_add_google(name = 'Recursive',
family = 'Recursive')
showtext_auto()
<- marmap::getNOAA.bathy(lon1 = -180, lon2 = 180,
bathy lat1 = -90, lat2 = 90,
res = 15, keep = TRUE,
antimeridian=TRUE)
<- marmap::as.SpatialGridDataFrame(bathy)
sp_grid sp_grid
<- as.data.frame(sp_grid) %>%
df rename(lon=s1, lat=s2)
<- df %>%
df_sf ::st_as_sf(coords = c("lon", "lat"),
sfcrs = 4326) %>%
::st_transform(crs = "+proj=rpoly")
sf df_sf
# Load world data
<- ne_countries(scale = "medium",
world returnclass = "sf") %>%
::st_transform(crs = "+proj=rpoly") %>%
sf::st_make_valid() sf
ggplot() +
geom_sf(data = df_sf,
aes(color = layer),
show.legend = F)+
geom_sf(data = world,
fill = "#d1cdb5",
color = NA, alpha = 0.7) + # Land
coord_sf()+
labs(title = "The Earth Without Borders",
subtitle = "A water-centric view in Rectangular Polyconic projection",
caption = "Source: Natural Earth | #30DayMapChallenge Day30 | @fgazzelloni") +
theme(text = element_text(family = "Recursive"),
plot.title = element_text(size = 44,
face = "bold",
hjust = 0.5),
plot.subtitle = element_text(size = 20,
hjust = 0.5,
color = "gray50"),
plot.caption = element_text(size = 20,
hjust = 0.5,
color = "gray70"),
plot.background = element_rect(fill = "#f7f7f5",
color = NA))
ggsave("day30_the_final_map.png",
bg = "white",
width = 8, height = 8,
units = "cm")