- mapping, data
Standard ggplot2 layer arguments (typically unused).
- ...
Additional parameters passed to the layer (rarely needed).
- location
Character. One of `"bl"`, `"br"`, `"tr"`, `"tl"`; placement
relative to panel edges. Default: `"bl"`.
- style
Character. Scale bar style: `"segment"` (default), `"bar"`, or
`"ticks"`.
- fixed_width
Numeric. Bar width in *native CRS units* (for example,
meters). Overrides automatic width selection.
- crs_unit
Character. CRS units (for example `"m"`, `"ft"`, `"°"`).
Usually auto-detected; set only when auto-detection is not possible.
- crs
An [sf::st_crs] object or a PROJ string. Fallback CRS when the
plot does not provide one (for example, when not using `coord_sf()`).
- display_unit
Character. Display units for labels (for example `"m"`,
`"km"`). Ignored when `geographic_mode = "degrees"`.
- unit_labels
Named character vector for custom unit labels, e.g.
`c(km = "Kilometers", m = "Meters", "°" = "°")`.
- width_hint
Numeric in (0, 1]. Target fraction of the panel width used
by the bar. Default: `0.25`.
- unit_category
Character. `"metric"` (default) or `"imperial"`. Affects
automatic promotion of units (m → km, ft → mi).
- bar_cols
Character vector of length two. Fill colours for `"bar"`
style blocks. Default: `c("black", "white")`.
- line_width
Numeric. Line width for outlines and ticks. Default: `1`.
- height
[grid::unit]. Bar height. Default: `unit(0.25, "cm")`.
- pad_x, pad_y
[grid::unit]. Padding from panel edges. Default:
`unit(0.25, "cm")`.
- text_pad
[grid::unit]. Gap between the bar and text labels. Default:
`unit(0.15, "cm")`.
- text_cex, text_face, text_family
Font settings for labels. Defaults:
`0.7`, `NULL`, `""`.
- tick_height
Numeric in [0, 1]. Relative height of interior ticks for
`"ticks"` style. Default: `0.6`.
- segments
Integer. For `"segment"` style, number of major divisions.
If `NULL`, an automatic, readable choice is used.
- label_show
Which ticks get labels: `"ends"` (default), `"all"`,
`"major"`, a numeric frequency (for example `2`), or a numeric vector of
1-based indices.
- minor_tick_height
Numeric in [0, 1]. For `"segment"` style, relative
height of minor ticks. Default: `0`.
- geographic_mode
Character, for **geographic CRS** only:
* `"approx_m"`: approximate meters/kilometers (default; warns about
approximation).
* `"degrees"`: show raw degrees (no metric conversion).
- text_col, line_col
Colours for text labels and outlines/ticks.
Defaults: `"black"`, `"black"`.