Learn R Programming

inlmisc (version 0.3.2)

AddScaleBar: Add Scale Bar to Plot

Description

This function can be used to add a scale bar to a plot.

Usage

AddScaleBar(asp = 1, unit = NULL, is.lonlat = FALSE,
  loc = c("bottomleft", "topleft", "topright", "bottomright"), offset = c(0,
  0), lab.vert.exag = NULL)

Arguments

asp

'numeric'. y/x aspect ratio for spatial axes.

unit

'character'. Axis unit of measurement, for example "METERS".

is.lonlat

'logical'. If true, plot coordinates are in longitude and latitude.

loc

'character'. Position of the scale bar in the plot region: "bottomleft", "topleft", "topright", or "bottomright" to denote scale location.

offset

'numeric'. The x and y adjustments of the scale bar, in inches.

lab.vert.exag

'logical'. If true, a label is drawn specifying the vertical exaggeration.

Value

Used for the side-effect of a scale bar drawn on the current graphics device.

See Also

PlotCrossSection, PlotMap

Examples

Run this code
# NOT RUN {
plot(-100:100, -100:100, type = "n", xlab = "x", ylab = "y", asp = 2)
AddScaleBar(2, unit = "FEET", loc = "topleft")
AddScaleBar(2, unit = "METERS", loc = "bottomright", offset = c(-0.2, 0))

# }

Run the code above in your browser using DataLab