Learn R Programming

cartography (version 1.4.1)

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 = TRUE, south = FALSE, extent = NULL)

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
wheither displaying a frame (TRUE) or not (FALSE).
north
wheither displaying a Noth arrow (TRUE) or not (FALSE).
south
wheither displaying a South arrow (TRUE) or not (FALSE).
extent
a SpatialPolygonsDataFrame or a SpatialPointsDataFrame; set the extent of the frame to the one of a Spatial object. (optional)

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
data("nuts2006")
# Example 1
plot(nuts0.spdf, col = "grey60",border = "grey20", add=FALSE)
# Layout plot
layoutLayer()

# Example 2
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,
            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 = "",
            author = "Eurostat, 2008", theme = "green.pal")

Run the code above in your browser using DataLab