legendextrud: Legend

Description Usage Arguments Examples

View source: R/legendextrud.R

Description

Legend

Usage

 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
)

Arguments

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

Examples

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.")

neocarto/mapextrud documentation built on April 10, 2020, 12:13 a.m.