## S3 method for class 'gps':
plot(x,
xlab="", ylab="",
asp,
clongitude, clatitude, span,
projection, parameters=NULL, orientation=NULL,
expand=1,
mgp=getOption("oceMgp"),
mar=c(mgp[1]+1,mgp[1]+1,1,1),
bg,
axes=TRUE, cex.axis=par('cex.axis'),
add=FALSE, inset=FALSE,
geographical=0,
debug=getOption("oceDebug"),
...)plot.gps
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, eclongitude and clatitude are provided,
then any provided value of asp is ignored, and instead the plot
aspect ratio is computed based onspan. A value for
span must bmapPlot);
if not given, a cartesian frame is used, scaled so that gps shapes
near the centre of the plot are preserved. If a projection is provided,
thmapPlot.mapPlot.expand is ignored if either xlimpar(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.par("mar").TRUE to plot axes.TRUE to draw the gps on an existing
plot. Note that this retains the aspect ratio of that existing plot, so
it is important to set that correctly, e.g. with asp=1/cos(lat * pi
/ 180), where TRUE for use within plotInset. The
effect is to prevent the present function from adjusting margins, which
is necessary because margin adjustment is the basis for the methgeographical=0, the axes are conventional, with decimal degrees as
the unit, and negative signs indicating the southern and western
hemispheres. If geographical=1, the sigTRUE to get debugging information during
processing.yaxp=c(-90,90,4) for a plot extending from pole
to pole. To get an inset map inside another map, draw the first map, do
par(new=TRUE), and then call plot.gps with a value of
mar that moves the inset plot to a desired location on the existing
plot, and with bg="white".
gps-class explains the structure
of gps objects, and also outlines the other functions dealing with them.library(oce)
gps <- read.oce("~/Dropbox/dalwhoi.gpx")
plot(gps)
lines(coastlineWorld[["longitude"]], coastlineWorld[["latitude"]])Run the code above in your browser using DataLab