View source: R/reorder_layers.R
reorder_layers | R Documentation |
basemap
land, glacier and grid layers on top of other ggplot layersMoves existing land, glacier and grid layers on top of other layers. Useful for hiding region polygons under land.
reorder_layers(p)
p |
ggplot object from the |
This function has not been tested properly yet and is likely to contain bugs.
Returns a ggplot object with land, glacier and grid layers on top.
Mikko Vihtakari
Other customize shapefiles:
auto_limits()
,
theme_map()
if(requireNamespace("ggspatial", quietly = TRUE)) {
data("ices_areas")
p <- basemap(c(-20, 15, 50, 70)) +
ggspatial::annotation_spatial(ices_areas, aes(fill = Area_Full), show.legend = FALSE)
# Polygons on top of land
p
# Move land on top
reorder_layers(p)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.