Learn R Programming

cartography (version 1.4.1)

barscale: Scale Bar

Description

Plot a scale bar.

Usage

barscale(size = NULL, lwd = 1.5, cex = 0.6, pos = NULL, style = "pretty")

Arguments

size
size of the scale bar in kilometers. If set to NULL, an automatic scale bar is displayed (1/10 of the map width).
lwd
width of the scale bar.
cex
cex of the text.
pos
position of the legend, default to the bottom right corner of the map. A vector of two coordinates (c(x, y) is possible.
style
style of the legend, either "pretty" or "oldschool". The "oldschool" style only uses the "size" parameter.

See Also

layoutLayer

Examples

Run this code
data("nuts2006")
plot(nuts0.spdf, col = "grey60",border = "grey20", add=FALSE)
barscale(size = 1000)
barscale(size = 500, lwd = 3, cex = .9, pos = c(3553000, 1449000))

plot(nuts0.spdf, col = "grey60",border = "grey20", add=FALSE)
barscale(style = "oldschool")

Run the code above in your browser using DataLab