tmap-element
that draw spatial lines.tm_lines(col = NA, lwd = 1, lty = "solid", alpha = NA, scale = 1,
lwd.legend = NULL, lwd.legend.labels = NULL, n = 5,
style = ifelse(is.null(breaks), "pretty", "fixed"), breaks = NULL,
palette = NULL, labels = NULL, auto.palette.mapping = TRUE,
contrast = 1, max.categories = 12, colorNA = NA, textNA = "Missing",
title.col = NA, title.lwd = NA, legend.col.show = TRUE,
legend.lwd.show = TRUE, legend.format = list(),
legend.col.is.portrait = TRUE, legend.lwd.is.portrait = FALSE,
legend.hist = FALSE, legend.hist.title = NA, legend.col.z = NA,
legend.lwd.z = NA, legend.hist.z = NA, id = NA)
col
is used (normally 1).lwd.legend
.lwd
is the name of a numeric variable.col
is a numeric variable. Discrete options are "cat"
, "fixed"
, "sd"
, "equal"
, "pretty"
, "quantile"
, "kmeans"
, <style=="fixed"
, breaks should be specifiedRColorBrewer::display.brewer.all
) for the lines. Only when col
is set to a variable. The default palette is taken from tm_layout
's argument aes.palette
auto.palette.mapping=TRUE
). Both numbers should be between 0 and 1. The first number determines where the palette begins, and tcol
is the name of a categorical variable, this value determines how many categories (levels) it can have maximally. If the number of levels is higher than max.categories
, then levels are combined.NA
to omit text for missing values in the legendlabels
is undefined. Parameters are:
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]TRUE
) or landscape (FALSE
)TRUE
) or landscape (FALSE
)legend.col.z
)legend.col.z
)itmap
).by
argument in tm_facets
, or by defining multiple variables in the aesthetic arguments. The aesthetic arguments of tm_lines
are col
and lwd
. In the latter case, the arguments, except for the ones starting with legend.
, can be specified for small multiples as follows. If the argument normally only takes a single value, such as n
, then a vector of those values can be specified, one for each small multiple. If the argument normally can take a vector, such as palette
, then a list of those vectors (or values) can be specified, one for each small multiple.vignette("tmap-nutshell")
}data(World, Europe, rivers)
qtm(rivers, line.col = "navy")
tm_shape(Europe) +
tm_fill("MAP_COLORS", palette = "Pastel2") +
tm_shape(rivers) +
tm_lines(col="black", lwd="scalerank", scale=2, legend.lwd.show = FALSE) +
tm_layout("Rivers of Europe") +
tm_style_cobalt()
Run the code above in your browser using DataLab