Last chance! 50% off unlimited learning
Sale ends in
tm_shape
.
tm_scale_bar(breaks = NULL, width = NA, size = 0.5, text.color = NA, color.dark = "black", color.light = "white", lwd = 1, position = NA, just = NA)
width
of the scale bar. Not available for view mode.breaks=NULL
. In plot mode, it corresponds the relative width; the default is 0.25 so one fourth of the map width. In view mode, it corresponds to the width in pixels; the default is 100.attr.color
of tm_layout
."attr.position"
of tm_layout
."left"
, "right"
, "center"
, "bottom"
, and "top"
. Numeric values of 0 specify left/bottom alignment and 1 right/top alignment. This option is only used, if position
is specified by numeric coordinates. The default value is controlled by the argument "attr.just"
of tm_layout
.current.mode <- tmap_mode("plot")
data(NLD_muni)
qtm(NLD_muni, theme = "NLD") + tm_scale_bar(position=c("left", "bottom"))
data(Europe)
tm_shape(Europe, unit = "mi") +
tm_polygons() +
tm_scale_bar() + tm_layout(attr.outside = TRUE)
# restore current mode
tmap_mode(current.mode)
Run the code above in your browser using DataLab