Learn R Programming

tmap (version 1.0)

tm_credits: Credits text

Description

Creates a text annotation that could be used for credits or acknowledgements.

Usage

tm_credits(text, size = 0.7, position = c("right", "bottom"),
  bg.color = NA, bg.alpha = NA)

Arguments

text
text
size
relative text size
position
position of the text. Vector of two values, specifing the x and y coordinates. Either this vector contains "left", "center" or "right" for the first value and "top", "center", or "bottom" for the second value, or this vector contains two numeric values be
bg.color
background color for the text
bg.alpha
Transparency number between 0 (totally transparent) and 1 (not transparent). By default, the alpha value of the bg.color is used (normally 1).

Examples

Run this code
data(NLD_muni)
data(NLD_prov)

tm_shape(NLD_muni) +
    tm_fill(col="population", convert2density=TRUE, 
        style="kmeans", title="Population (per km2)") +
    tm_borders("grey25", alpha=.5) + 
    tm_shape(NLD_prov) +
    tm_borders("grey40", lwd=2) +
tm_layout_NLD(bg.color="white", draw.frame = TRUE) +
tm_credits("(c) Statistics Netherlands (CBS) and\nKadaster Nederland", position=c("left", "bottom"))

Run the code above in your browser using DataLab