Skip to contents

Add a scale bar

Usage

add_scale_bar(
  text_size = 0.6,
  position = c("left", 0.01),
  color_dark = cols_reach("black"),
  breaks = c(0, 50, 100),
  ...
)

Arguments

text_size

Relative font size.

position

Position of the compass. Vector of two values, specifying the x and y coordinates.

color_dark

Color of the dark parts of the compass.

breaks

Breaks of the scale bar. If not specified, breaks will be automatically be chosen given the prefered width of the scale bar. Example: c(0, 50, 100).

...

Other arguments to pass to `tmap::tm_compass()`.

Value

A tmap layer.