View source: R/tm_misc_elements.R
tm_logo | R Documentation |
Creates a map logo. Multiple logos can be specified which are shown next to each other. Logos placed on top of each other can be specified with stacking tm_logo
elements.
tm_logo(
file,
height = 3,
halign = "center",
margin = 0.2,
position = NA,
just = NA
)
file |
either a filename or url of a png image. If multiple files/urls are provided with a character vector, the logos are placed near each other. To specify logos for small multiples use a list of character values/vectors. In order to stack logos vertically, multiple |
height |
height of the logo in number of text line heights. The width is scaled based the height and the aspect ratio of the logo. If multiple logos are specified by a vector or list, the heights can be specified accordingly. |
halign |
if logos in one row have different heights, |
margin |
margin around the logo in number of text line heights. |
position |
position of the logo. 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 |
just |
Justification of the attribute relative to the point coordinates. The first value specifies horizontal and the second value vertical justification. Possible values are: |
## Not run:
data(NLD_muni, NLD_prov)
tm_shape(NLD_muni) +
tm_polygons("origin_native", border.alpha=0.5, style="cont", title="Native Dutch (%)") +
tm_logo("http://statline.cbs.nl/Statweb/Images/cbs_logo.png",
position=c("left", "bottom"), height = 2) +
tm_layout(bg.color="gray98")
data(World)
tm_shape(World) +
tm_polygons("HPI", palette="RdYlGn") +
tm_logo(c("https://www.r-project.org/logo/Rlogo.png",
system.file("img/tmap.png", package="tmap"))) +
tm_logo("http://blog.kulikulifoods.com/wp-content/uploads/2014/10/logo.png",
height=5, position = c("left", "top")) +
tm_format("World")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.