map.scale: map.scale

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Draws a scale bar on a map.

Usage

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

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.

Details

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

Value

None (see above)

Author(s)

Chris Brunsdon

See Also

choro.legend

Examples

1
2
3
4
5
6
7
8
# 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)')

Example output

Loading required package: maptools
Loading required package: sp
Checking rgeos availability: TRUE
Loading required package: RColorBrewer
Loading required package: MASS
Loading required package: rgeos
rgeos version: 0.3-23, (SVN revision 546)
 GEOS runtime version: 3.4.2-CAPI-1.8.2 r3921 
 Linking to sp version: 1.2-3 
 Polygon checking: TRUE 

GISTools documentation built on May 6, 2019, 1:09 a.m.