Description Usage Arguments Examples
Legend
1 2 3 4 5 6 7 8 9 10 11 | legendextrud(
x,
var,
k,
title.txt = "Title of the legend",
unit = "",
title.cex = 0.8,
values.cex = 0.6,
pos = NULL,
title.font = 2
)
|
x |
an sf object (polygon or multipolygons). |
var |
name of the numeric field in df to plot. |
k |
numeric value to adjust the height of the extruded polygons |
title.txt |
Title of the legend |
unit |
unit of the variable |
title.cex |
title cex |
values.cex |
velues cex |
pos |
c(x,y) position on the legend |
title.font |
title font |
1 2 3 4 5 | library(sf)
us <- st_read(system.file("us.gpkg", package="mapextrud"))
basemap <- deform(us)
extrude(basemap, var = "pop2019" , k = 1, col = "white")
legendextrud(x = basemap, var = "pop2019", k = 1, title.txt = "Population in 2019", unit = "inh.")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.