Learn R Programming

cartography (version 2.1.0)

layoutLayer: Layout Layer

Description

Plot a layout layer.

Usage

layoutLayer(title = "Title of the map, year", sources = "Source(s)",
  author = "Author(s)", col = "black", coltitle = "white", theme = NULL,
  bg = NULL, scale = 0, frame = TRUE, north = FALSE, south = FALSE,
  extent = NULL, tabtitle = FALSE, postitle = "left")

Arguments

title

title of the map.

sources

sources of the map (or something else).

author

author of the map (or something else).

col

color of the title box and frame border.

coltitle

color of the title.

theme

name of a cartographic palette (see carto.pal.info). col and coltitle are set according to the chosen palette.

bg

color of the frame background.

scale

size of the scale bar in kilometers. If set to NULL, no scale bar is displayed, if set to 0 an automatic scale bar is displayed (1/10 of the map width).

frame

whether displaying a frame (TRUE) or not (FALSE).

north

whether displaying a North arrow (TRUE) or not (FALSE).

south

whether displaying a South arrow (TRUE) or not (FALSE).

extent

sf object or Spatial*DataFrame; sets the extent of the frame to the one of a spatial object. (optional)

tabtitle

size of the title box either a full banner (FALSE) or a "tab" (TRUE).

postitle

position of the title, one of "left", "center", "right".

Details

If extent is not set, plot.new has to be called first. The size of the title box in layoutLayer is fixed to 1.2 lines height.

See Also

labelLayer

Examples

Run this code
# NOT RUN {
# Example 1
library(sf)
mtq <- st_read(system.file("shape/martinique.shp", package="cartography"))
plot(st_geometry(mtq), col = "grey60",border = "grey20")
# Layout plot
layoutLayer()

# Example 2
library(sp)
data("nuts2006")
plot(nuts0.spdf, col=NA, border = NA, bg ="#A6CAE0")
plot(world.spdf, col  = "#E3DEBF", border=NA, add=TRUE)
plot(nuts0.spdf, col = "#D1914D",border = "white", lwd=1, add=TRUE)
layoutLayer(col = NA, coltitle = "black",
            sources = "", author = "",
            frame = FALSE, postitle = "center",
            south = TRUE)

# Example 3
nuts3.df$gdphab <- 1000000 * nuts3.df$gdppps2008 / nuts3.df$pop2008
choroLayer(spdf = nuts3.spdf, df = nuts3.df, var = "gdphab",
           legend.pos = "right", border = NA, nclass = 6,
           col = carto.pal('green.pal', 6))
# Layout plot
layoutLayer(title = "GDP per Inhabitants", sources = "", 
            tabtitle = TRUE, scale = NULL,
            author = "Eurostat, 2008", theme = "green.pal")
# }

Run the code above in your browser using DataLab