mapscale: A scale function to add beside a map

Usage Arguments

Usage

1
2
3
4
mapscale(x, y, relwidth = 0.15, metric = TRUE, ratio = TRUE,
  cols = rep(c("black", "white"), 10), cex = 0.8, projected = FALSE,
  epsg = 4326, inset = 0, mark = "Albers Equal Area Conic USGS version",
  madj = 0, ...)

Arguments

x

A geo-object,

y

a state abbrebriation, e.g. "CA",

relwidth

margin added to maps,

\item

metricif metric system is used? TRUE default

\item

ratiodefault = TRUE

\item

colsblack and white interval

\item

projectedif projection is used

\item

insetis for box into the plot margin

\item

markmark is the text line under the scale ba

\item

madjadjustment

\item

magmagnification 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))


kevinlzheng/statemaps documentation built on May 20, 2019, 1:56 p.m.