plot.coastline {oce} | R Documentation |
Plot a coastline.
## S3 method for class 'coastline': plot(x, asp, mgp=getOption("oce.mgp"), mar=c(mgp[1], mgp[1], par("cex"), par("cex")), bg, axes=TRUE, ...)
x |
A coastline object, e.g. as read by
read.coastline or created by
as.coastline . |
asp |
Aspect ratio for plot. The default is for
plot.coastline to set the aspect ratio to give natural
latitude-longitude scaling somewhere near the centre latitude on the
plot. Often, it makes sense to set asp yourself, e.g. to get
correct shapes at 45N, use asp=1/cos(45*pi/180) .
Note that the land mass is not symmetric about the equator, so
to get good world views you should set asp=1 or
set ylim to be symmetric about zero. |
mgp |
3-element numerical vector to use for par(mgp) , and
also for par(mar) , computed from this. The default is
tighter than the R default, in order to use more space for the
data and less for the axes. |
mar |
value to be used with par("mar") . |
bg |
optional colour to be used for the background of the map. This comes in handy for drawing insets (see “details”). |
axes |
boolean, set to TRUE to plot axes. |
... |
optional arguments passed to plotting functions. For
example, set yaxp=c(-90,90,4) for a plot extending from pole to
pole. |
This function plots a coastline. An attempt is made to fill the space of the plot, and this is done by limiting either the longitude range or the latitude range, as appropriate, by modifying the eastern or northern limit, as appropriate.
To get an inset map inside another map, draw the first map, do
par(new=TRUE)
, and then call plot.coastline
with a value
of mar
that moves the inset plot to a desired location on the
existing plot, and with bg="white"
.
None.
Dan Kelley
read.coastline
can read coastlines from data
files, provided that they are in a certain class of formats. A
coastline may be summarized by summary.coastline
.
library(oce) data(coastline.world) plot(coastline.world)