View source: R/tm_misc_elements.R
tm_credits | R Documentation |
Creates a text annotation that could be used for credits or acknowledgements.
tm_credits(
text,
size = 0.7,
col = NA,
alpha = NA,
align = "left",
bg.color = NA,
bg.alpha = NA,
fontface = NA,
fontfamily = NA,
position = NA,
width = NA,
just = NA
)
text |
text. Multiple lines can be created with the line break symbol |
size |
relative text size |
col |
color of the text. By default equal to the argument |
alpha |
transparency number between 0 (totally transparent) and 1 (not transparent). By default, the alpha value of |
align |
horizontal alignment: |
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 |
fontface |
font face of the text. By default, determined by the fontface argument of |
fontfamily |
font family of the text. By default, determined by the fontfamily argument of |
position |
position of the text. Vector of two values, specifying the x and y coordinates. Either this vector contains "left", "LEFT", "center", "right", or "RIGHT" for the first value and "top", "TOP", "center", "bottom", or "BOTTOM" for the second value, or this vector contains two numeric values between 0 and 1 that specifies the x and y value of the center of the text. The uppercase values correspond to the position without margins (so tighter to the frame). The default value is controlled by the argument |
width |
the width of the credits text box, a numeric value that is relative to the map area (so 1 means the whole map width). By default ( |
just |
Justification of the attribute relative to the point coordinates. The first value specifies horizontal and the second value vertical justification. Possible values are: |
tm_xlab
current.mode <- tmap_mode("plot")
data(NLD_muni, NLD_prov)
tm_shape(NLD_muni) +
tm_fill(col="population", convert2density=TRUE,
style="kmeans", title = expression("Population (per " * km^2 * ")")) +
tm_borders("grey25", alpha=.5) +
tm_shape(NLD_prov) +
tm_borders("grey40", lwd=2) +
tm_format("NLD", bg.color="white", frame = TRUE) +
tm_credits("(c) Statistics Netherlands (CBS) and\nKadaster Nederland", position=c("left", "bottom"))
# restore current mode
tmap_mode(current.mode)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.