reorder_layers: Move 'basemap' land, glacier and grid layers on top of other...

View source: R/reorder_layers.R

reorder_layersR Documentation

Move basemap land, glacier and grid layers on top of other ggplot layers

Description

Moves existing land, glacier and grid layers on top of other layers. Useful for hiding region polygons under land.

Usage

reorder_layers(p)

Arguments

p

ggplot object from the basemap function.

Details

This function has not been tested properly yet and is likely to contain bugs.

Value

Returns a ggplot object with land, glacier and grid layers on top.

Author(s)

Mikko Vihtakari

See Also

Other customize shapefiles: auto_limits(), theme_map()

Examples

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)
 
 }

ggOceanMaps documentation built on May 29, 2024, 5:36 a.m.