scale.bar: Draw Scale Bar

View source: R/scale.bar.R

scale.barR Documentation

Draw Scale Bar

Description

Display a scale bar on a map.

Usage

## S3 method for class 'bar'
scale(
  longitude,
  latitude,
  length = 100,
  units = "km",
  convert = TRUE,
  number = 4,
  double = TRUE,
  thickness = 0.05,
  pos = 1,
  margin = 0.25,
  cex = 0.6,
  colours = "black",
  ...
)

Arguments

longitude

A numerical value specifying the longitude where the scale bar is to be drawn.

latitude

A numerical value specifying the latitude where the scale bar is to be drawn.

length

A numerical value specifying the length of the scale bar to be drawn. The units are specified by the units argument.

units

A character string specifying the length units to be used. At present, the only options are ‘km’ or ‘kilometers’.

convert

A logical value specifying whether or not to convert the length argument to the degree scale.

number

A numerical value specifying the number of intervals to include on the scale bar.

double

A logical value specifying whether the scale bar is to be composed of a double or single bar.

thickness

A numerical value specifying the thickness of the scale bar in inches.

pos

A numerical value specifying the position of the scale bar. It may take the following values: 1 = Lower-left corner, 2 = Lower-right corner, 3 = Upper-right corner and 4 = Upper-left corner.

margin

A numerical value specifying the margin of separation between scale bar and the axis borders in inches. It is used in conjunction with the pos argument.

cex

Character expansion value for the scale bar labels.

colours

Scale bar colours.

Examples

map.new() # Create new window.
map("coast")    # Plot empty map.
scale.bar()


TobieSurette/gulf.spatial documentation built on Sept. 26, 2024, 7:41 p.m.