Map component that adds a scale bar.
tm_scalebar(
breaks,
width,
allow_clipping,
text.size,
text.color,
color.dark,
color.light,
lwd,
position,
group_id,
bg,
bg.color,
bg.alpha,
size = "deprecated",
stack,
frame,
frame.color,
frame.alpha,
frame.lwd,
frame.r,
margins,
z
)Scale bar break positions. E.g. c(0, 10, 50) places breaks
at 0, 10, and 50 units. The unit is controlled by the unit argument from tm_shape().
When NULL (default), break positions are chosen automatically.
Width of the scale bar, in number of text line heights (roughly
equivalent to character widths). When breaks are specified, width is
only useful for fine-tuning, e.g. to prevent label clipping or reduce
excess whitespace.
Should clipping of the last label be allowed? If
TRUE (default), the last break label including its unit suffix is printed
even when it extends beyond the frame. If FALSE, that label is suppressed
and the unit suffix is appended to the second-to-last label instead.
text size
text.color
color.dark
color.light
linewidth
The position specification of the component: an object created with tm_pos_in() or tm_pos_out(). Or, as a shortcut, a vector of two values, specifying the x and y coordinates. The first is "left", "center" or "right" (or upper case, meaning tighter to the map frame), the second "top", "center" or "bottom". Numeric values are also supported, where 0, 0 means left bottom and 1, 1 right top. See also vignette: Positioning of components. In case multiple components should be combined (stacked), use group_id and specify component in tm_components().
Component group id name. All components (e.g. legends, titles, etc) with the same group_id will be grouped. The specifications of how they are placed (e.g. stacking, margins etc.) are determined in tm_components() where its argument id should correspond to group_id.
Show background?
Background color
Background transparency
Deprecated (use text.size instead)
stack with other map components, either "vertical" or "horizontal".
frame should a frame be drawn?
frame color
frame alpha transparancy
frame line width
Radius of the rounded frame corners. 0 means no rounding.
margins
z index, e.g. the place of the component relative to the other componets