tm_shape(ei_elev) +
tm_raster(style = "cont",
palette = "-RdYlGn",
title = "Elevation (m asl)") +
tm_shape(ei_borders) +
tm_borders() +
tm_shape(ei_roads) +
tm_lines(lwd = "strokelwd",
legend.lwd.show = FALSE) +
tm_shape(volcanoes) +
tm_symbols(shape = 24,
size = "elevation",
title.size = "Volcanoes (m asl)") +
tm_layout(main.title = "Easter Island",
bg.color = "lightblue") +
tm_scale_bar(position = c("left", "bottom")) +
tm_compass(show.labels = 1)
Create a Map of Easter Island with tmap
Create an Interactive Map of Easter Island with tmap
<- tm_shape(ei_elev) +
ei_map tm_raster(style = "cont",
palette = "-RdYlGn",
title = "Elevation (m asl)") +
tm_shape(ei_borders) +
tm_borders() +
tm_shape(ei_roads) +
tm_lines(lwd = "strokelwd",
legend.lwd.show = FALSE) +
tm_shape(volcanoes) +
tm_symbols(shape = 24,
size = "elevation",
title.size = "Volcanoes (m asl)") +
tm_layout(main.title = "Easter Island",
bg.color = "lightblue") +
tm_scale_bar(position = c("left", "bottom")) +
tm_compass(show.labels = 1)
tmap_mode("view")
ei_map
Create a Map of Easter Island with ggplot2
#| message: false
#| warning: false
#| eval: false
<- volcanoes %>%
volcanoes_point mutate(lon = unlist(map(volcanoes$geom,1)),
lat = unlist(map(volcanoes$geom,2)))
ggplot() +
geom_sf(data = ei_borders, color = "#212529") +
geom_stars(data = ei_elev) +
scale_fill_distiller(name = "Elevation (m asl)",
palette = "RdYlGn", na.value = "transparent") +
geom_sf(data = ei_roads, color = "#343a40") +
geom_point(data = volcanoes_point,
aes(x = lon, y = lat, size = elevation),
shape = 17, color = "#22577a") +
scale_size_continuous(name = "Volcanoes (m asl)") +
::annotation_north_arrow(location = "tr", which_north = "true") +
ggspatial::annotation_scale(location = "br", width_hint = 0.5) +
ggspatiallabs(title = "Easter Island") +
theme_minimal()