sl.plot.naturalearth | R Documentation |
Plot Natural Earth data.
sl.plot.naturalearth(plot.init.res=NULL, load.res=NULL, what="coastline", resolution="medium", poly.split=TRUE, lines.col="black", lwd=1, lty=1, fill.col="grey", fill.refine.boundary=TRUE, fill.refine.boundary.precision=1, polygon.borders=TRUE, polygon.borders.lwd=0.1, polygon.borders.col=fill.col, points.text=TRUE, points.text.col="black", points.text.cex=1, points.text.adj=NULL, points.text.pos=NULL, points.text.offset=0.5, points.text.vfont=NULL, points.text.font=NULL, points.points=FALSE, points.pch=20, points.col="black", points.cex=1, ignore.visibility=FALSE, naturalearth.dir="~/naturalearthdata", verbose=TRUE)
plot.init.res |
a spheRlab plot specifics list as returned by |
load.res |
a list as returned by |
what |
a character or character vector specifying which type of Natural Earth data to plot, e.g., 'coastline'. To list all possible values for the specified resolution, set what='list'. If 'what' contains more than one element, they are plotted in the order they are provided, that is, the last one will always be in the foreground. Ignored if load.res is not NULL. |
resolution |
a character or character vector sepcifying which resolution(s) to use. Possible values are 'coarse' (1:110Mio), 'medium' (1:50Mio; default), and 'fine' (1:10Mio). Ignored if load.res is not NULL. |
poly.split |
a logical value indicating whether polygon objects (e.g. if |
lines.col |
a colour or vector of colours to be used for line objects. Default is |
lwd |
a scalar or numeric vector specifying the line width. |
lty |
a line type or vector of line types. |
fill.col |
a colour or vector of colours to be used for filling polygons. |
fill.refine.boundary |
a logical value or vector of logical values indicating whether or not to refine truncated polygons along curved plot boundaries (in polar projection). |
fill.refine.boundary.precision |
a scalar or numeric vector specifying the precision (in degrees) for the refinement of truncated polygons along curved plot boundaries (in polar projection). |
polygon.borders |
a logical value or vector of logical values indicating whether or not to plot lines along polygon edges. Default is |
polygon.borders.lwd |
a scalar or numeric vector specifying the polygon border width. Default is |
polygon.borders.col |
a colour or vector of colours for polygon edges. Default is |
points.text |
a logical value or vector of logical values indicating whether names associated with point objects shall be plotted. |
points.text.col |
a colour or vector of colours to be used for text. |
points.text.cex |
a scalar or numeric vector specifying the size scaling factor for text. |
points.text.adj |
a numeric vector of length 2 with values in [0, 1] specifying the x and y adjustment of text. |
points.text.pos |
a position specifier or vector of position specifiers for the text. If specified this overrides any |
points.text.offset |
a scalar or numeric vector. When |
points.text.vfont |
NULL for the current font family, or a character vector of length 2 for Hershey vector fonts. The first element of the vector selects a typeface and the second element selects a style. |
points.text.font |
If |
points.points |
a logical value or vector of logical values indicating whether symbols shall be plotted at the locations of point objects. |
points.pch |
a point 'character' (or vector thereof). |
points.col |
a point colour (or vector thereof). |
points.cex |
a point size scaling factor (or vector thereof). |
ignore.visibility |
a logical value indicating whether or not objects shall be attempted to be drawn even if they are invisible, that is, outside the plot domain. |
naturalearth.dir |
a character specifying the local Natural Earth data directory. If data are downloaded from the internet, they will be save to this directory; if it does not yet exist, it will be created. Default is |
verbose |
a logical value indicating whether or not to print more information. |
This function, together with sl.load.naturalearth
, enables using the openly available and free-to-use Natural Earth data (http://www.naturalearthdata.com) - including coastlines, rivers, land and ocean polygons, and much more - in spheRlab.
If needed, this function invokes sl.load.naturalearth
to load (and possibly download from the internet) Natural Earth data before plotting. In this case, the package rgdal is needed to read the shape file(s).
If polygon objects are plotted, these are by default (optionally) split into better-behaving small subpolyons before plotting, see documentation of argument poly.split
in sl.load.naturalearth
.
Helge Goessling
http://www.naturalearthdata.com
sl.load.naturalearth
# plot coastlines at coarse resolution:
pir = sl.plot.init()
sl.plot.naturalearth(pir,what="coastline",resolution="coarse")
sl.plot.end(pir)
# list all possible 'what' values for fine resolution:
sl.plot.naturalearth(what="list",resolution="fine")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.