Learn R Programming

GISTools (version 1.0-1)

map.scale: map.scale

Description

Draws a scale bar on a map.

Usage

map.scale(xc,yc,len,units,ndivs,subdiv=1,tcol='black',scol='black',sfcol='black')

Value

None (see above)

Arguments

xc

The x-centre (in map units) of the scale bar

yc

The y-centre (in map units) of the scale bar

len

The length (in map units) of the scale bar

units

String specifying the name of the units for the scale bar

ndivs

The number of divisions (units marked) on the scale

subdiv

The fraction of units used to step along the divisions

tcol

The colour of text on the scale bar.

scol

The colour of the scale bar itself.

sfcol

The colour of the filled rectangles in the scale bar.

Author

Chris Brunsdon

Details

Draws an alternating bar scale on a map. Returns no value.

See Also

choro.legend

Examples

Run this code
# Read in map data for New Haven
data(newhaven)
# Plot census block boundaries
plot(blocks)
# Add a map scale
map.scale(534750,152000,miles2ft(2),"Miles",4,0.5,sfcol='red')
# ... and a title
title('New Haven (CT)')

Run the code above in your browser using DataLab