Scalebar: Scalebar for Projected Maps

Description Usage Arguments Value Author(s) Examples

View source: R/Scalebar.R

Description

Scalebar adds a distance scalebar onto a projected map. It is not appropriate for geographic projections.

Usage

1
Scalebar(x, y, distance, unit = "km", scale = 1, t.cex = 0.8)

Arguments

x

the x-axis position for the lower left corner of the bar

y

the x-axis position for the lower left corner of the bar

distance

the distance for which the scale bar should represent

unit

the units to report as the scaling

scale

the scaling factor to rescale the distance to a different unit. e.g., if your map is in m and want the scalebar to be in km, use a scale of 0.01

t.cex

the scaling of the font size to be used for the scalebar

Value

nothing is returned, simply a scalebar is added to a plot.

Author(s)

Jeremy VanDerWal jjvanderwal@gmail.com

Examples

1
2
3
4
5
6
7
8
9
#create a simple object of class 'asc'
tasc = as.asc(matrix(1:50,nr=50,nc=50)); print(tasc)

#plot the image
image(tasc,axes=FALSE,ann=FALSE)

#add a distance scalebar
Scalebar(x=5,y=5,distance=20) #show values in km
Scalebar(x=5,y=10,distance=20,unit='m',scale=1000) #show values in meters

Example output

Raster map of class "asc":
Cell size:  1 
Number of rows:  50 
Number of columns:  50 
Type:  numeric 

SDMTools documentation built on Jan. 11, 2020, 9:23 a.m.

Related to Scalebar in SDMTools...