scale.bar | R Documentation |
Display a scale bar on a map.
## 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",
...
)
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 |
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 |
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 |
cex |
Character expansion value for the scale bar labels. |
colours |
Scale bar colours. |
map.new() # Create new window.
map("coast") # Plot empty map.
scale.bar()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.