Learn R Programming

tmap (version 1.0)

tm_scale_bar: Scale bar

Description

Creates a scale bar. By default, the coordinate units are assumed to be meters, and the map units in kilometers. This can be changed in tm_shape.

Usage

tm_scale_bar(breaks = NULL, size = 0.5, position = c("right", "bottom"))

Arguments

breaks
breaks of the scale bar
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

Examples

Run this code
data(NLD_muni)
qtm(NLD_muni) + tm_scale_bar(position=c("left", "bottom"))

data(Europe)
tm_shape(Europe, unit = "miles", unit.size=1609) + tm_polygons() + tm_scale_bar()

Run the code above in your browser using DataLab