1 2 3 4 |
x |
A geo-object, |
y |
a state abbrebriation, e.g. "CA", |
relwidth |
margin added to maps, \itemmetricif metric system is used? TRUE default \itemratiodefault = TRUE \itemcolsblack and white interval \itemprojectedif projection is used \iteminsetis for box into the plot margin \itemmarkmark is the text line under the scale ba \itemmadjadjustment \itemmagmagnification default =1 |
Map scale was modified from the map package add scale to unprojected map if map has been projected, then use scale bar function, need to specify magnification for that. see Tanimura et al: auxiliary cartographic functions in R: North Arrow, Scale Bar, and label with a leader arrow the default ppi if not specified is 72 ppi/inch if px is specified, decimal degree is used to calculate actual distance map("usa") mapscale(x="bottomleft", relwidth = 0.2, mark ="", projected = F, ratio=F, inset = c(0.05, -0.05)) par(xpd =TRUE) plot(0:1,0:1) map("state", "ohio") mapscale(x="topleft", relwidth = 0.2,ratio=T) mapscale(x="topright", relwidth = 0.2,ratio=F) mapscale(x="bottomright", relwidth = 0.2,ratio=F) mapscale(x="bottomleft", relwidth = 0.2, projected =T, ratio=F) mapscale(x="center", relwidth = 0.2, projected =T, ratio=F) box() plot(us.states) mapscale(x="bottomright", relwidth = 0.2,ratio=F, projected =T, inset = c(0.1, 0.2)) mapscale(x="topright", relwidth = 0.2, ratio=F, projected =T, epsg = 2163, inset = c(0.1, 0.2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.