map.scale | R Documentation |
Draws a scale bar on a map.
map.scale(xc,yc,len,units,ndivs,subdiv=1,tcol='black',scol='black',sfcol='black')
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 |
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. |
Draws an alternating bar scale on a map. Returns no value.
None (see above)
Chris Brunsdon
choro.legend
# 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)')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.