Learn R Programming

oce (version 0.2-1)

plot.coastline: Plot a coastline

Description

Plot a coastline.

Usage

## S3 method for class 'coastline':
plot(x,
     xlab="", ylab="",
     asp,
     center, span,
     expand=1.5,
     mgp=getOption("oceMgp"), 
     mar=c(mgp[1]+1,mgp[1]+1,1,1),
     bg,
     fill='lightgray',
     axes=TRUE,
     debug=getOption("oceDebug"),
     ...)

Arguments

x
A coastline object, as read by read.coastline or created by as.coastline, or a list containing items named latitud
xlab
label for x axis
ylab
label for y axis
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
center
optional center of map, a vector containing latitude in degrees north, then longitude in degrees east. (Must be accompanied by span.)
span
optional suggested span of plot, in kilometers (must be supplied, if center is supplied).
expand
numerical factor for the expansion of plot limits, showing area outside the plot, e.g. if showing a ship track as a coastline, and then an actual coastline to show the ocean boundary. The value of expand is ignored if either
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).
fill
colour to be used to fill land regions. This is ignored unless the coastline object is fillable (e.g. for a "shapefile" read by read.coastline). Set to NULL to turn off fil
axes
boolean, set to TRUE to plot axes.
debug
set to TRUE to get debugging information during processing.
...
optional arguments passed to plotting functions. For example, set yaxp=c(-90,90,4) for a plot extending from pole to pole.

Value

  • None.

Details

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".

See Also

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.

Examples

Run this code
library(oce)
data(coastlineWorld)
plot(coastlineWorld)

Run the code above in your browser using DataLab