basemap | R Documentation |
A blank map is created that has approximatedly the correct aspect ratio for its latitude.
basemap(xlim, ylim, xlab = "Longitude", ylab = "Latitude", bg = "lightblue", ...)
xlim |
the x limits (x1, x2) of the plot. |
ylim |
the y limits of the plot. |
xlab |
a label for the x axis, defaults to "Longitude". |
ylab |
a label for the y axis, defaults to "Latitude". |
bg |
background colour for the map, defaults to "lightblue". |
... |
other arguments to be passed to |
The aspect ratio of the map is based on the approximation that the earth is a perfect sphere of 21600 nautical miles in circumference. The straight-line distance between two medidians that lie 1 degree apart is then 60 nautical miles *
cos(latitude). The aspect ratio is therefore set at the inverse of the cosine of the latitude at the middle of the y-scale.
If the plot window is re-sized the aspect ratio will remain correct but the background colour will not fill the full plot area.
Hans Gerritsen
data(landings)
data(coast)
xlim <- c(-11,-5.5)
ylim <- c(51.5,55.5)
basemap(xlim, ylim)
draw.shape(coast, col="cornsilk")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.