sl.plot.lonlatgrid | R Documentation |
Plot a simple longitude-latitude grid over a spheRlab plot.
sl.plot.lonlatgrid(plot.init.res, lon.0 = 0, lat.0 = 0, lon.distance = NULL, lat.distance = NULL, lon.range = c(-180,180), lat.range = c(-90,90), autodensity.f = 1, pole.hole = FALSE, precision = 1, lty = 1, lwd = 0.25, col = "black", labels = FALSE, labels.lat.every = 3, labels.lat.first = ceiling(labels.lat.every/2), labels.lat.offsetlatlon = c(0,0), labels.lon.every = 3, labels.lon.first = ceiling(labels.lon.every/2), labels.lon.offsetlatlon = c(0,0), labels.col = "grey", labels.cex = 1)
plot.init.res |
a spheRlab plot specifics list as returned by |
lon.0 |
a scalar specifying one of the longitudes (degrees east) to be drawn. |
lat.0 |
a scalar specifying one of the latitudes (degrees north) to be drawn. |
lon.distance |
a scalar specifying the distance (degrees) between adjacent longitudes. Default is |
lat.distance |
a scalar specifying the distance (degrees) between adjacent longitudes. Default is |
lon.range |
a two-element numeric vector specifying the longitude range in which grid lines are to be drawn. Default is |
lat.range |
a two-element numeric vector specifying the latitude range in which grid lines are to be drawn. Default is |
autodensity.f |
a scalar that can be used to adjust the density of automatically derived values for |
pole.hole |
a logical value indicating whether or not to let longitudinal lines end at the last latitude(s) before the pole(s). |
precision |
a scalar specifying the precision (degrees) at which longitudes and latitudes are broken into line segments (which are drawn as straight lines). |
lty |
a line type. |
lwd |
a scalar specifying the line width. |
col |
a line colour. |
labels |
a logical value indicating whether or not to add longitude and latitude labels. Note that the placement of labels is determined automatically based on the lon-lat-grid, with some arguments to control the behaviour. Latitude labels are placed between lines of longitudes and vice versa. For more flexibility, use |
labels.lat.every |
an integer specifying the density in latitudinal direction at which labels are plotted. Affects latitude and longitude labels coherently. |
labels.lat.first |
an integer specifying the first latitude to receive a latitude label. Affects latitude and longitude labels coherently such that longitude labels are placed between latitude labels. |
labels.lat.offsetlatlon |
a 2-element numeric vector specifying the degrees latitude and longitude by which latitude labels are to be shifted. |
labels.lon.every |
an integer specifying the density in longitudinal direction at which labels are plotted. Affects latitude and longitude labels coherently. |
labels.lon.first |
an integer specifying the first longitude to receive a longitude label. Affects longitude and latitude labels coherently such that latitude labels are placed between longitude labels. |
labels.lon.offsetlatlon |
a 2-element numeric vector specifying the degrees latitude and longitude by which longitude labels are to be shifted. |
labels.col |
the color to be used for the labels. |
labels.cex |
numeric character expansion factor for the labels; multiplied by |
Some standard lon-lat grids can also be plotted using sl.plot.naturalearth
.
If you set labels=TRUE
, note that the placement of labels is determined automatically based on the lon-lat-grid, with few arguments to control the behaviour. For more flexibility, use sl.plot.lonlatlabels
directly.
If grid lines are very dense, this function can be quite slow even if only a small map section is actually plotted. In such cases, the arguments lon.range
and lat.range
can be used to considerably speed up the process.
Helge Goessling
sl.plot.naturalearth
, sl.plot.lonlatlabels
## Not run:
pir = sl.plot.init()
sl.plot.naturalearth(pir, resolution="coarse")
sl.plot.lonlatgrid(pir, labels=TRUE, labels.lat.first=3, labels.lon.first=1, labels.cex=0.7, labels.col="red")
sl.plot.end(pir)
### Should result in a pdf file named 'sl.plot.pdf' in your home directory.
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.