Learn R Programming

marmap (version 1.0.10)

plotProfile: Ploting bathymetric data along a transect or path

Description

Plots the depth/altitude along a transect or path

Usage

plotProfile(profile,shadow=TRUE,xlim,ylim,col.sea,col.bottom,xlab,ylab, ...)

Value

a bivariate plot of depth against the kilometric distance from the starting point of a transect or least cost path.

Arguments

profile

4-columns matrix obtained from get.transect with argument dist=TRUE, or from path.profile.

shadow

logical. Should the depth profile cast a shadow over the plot background?

xlim, ylim

numeric vectors of length 2, giving the x and y coordinates ranges. If unspecified, xlim values are based on the length of the transect or path and ylim values are based on the depth range of the bathymetric matrix bathy.

col.sea

color for the sea area of the plot. Defaults to rgb(130/255,180/255,212/255)

col.bottom

color for the bottom area of the plot. Defaults to rgb(198/255,184/255,151/255)

xlab, ylab

titles for the x and y axes. If unspecified, xlab="Distance from start of transect (km)" and ylab="Depth (m)"

...

arguments to be passed to methods, such as graphical parameters (see par)

Author

Benoit Simon-Bouhet

See Also

path.profile, plot.bathy

Examples

Run this code

# Example 1:
	data(celt)
	layout(matrix(1:2,nc=1),height=c(2,1))
	par(mar=c(4,4,1,1))
	plot(celt,n=40,draw=TRUE)
	points(c(-6.34,-5.52),c(52.14,50.29),type="o",col=2)
	
	tr <- get.transect(celt, x1 = -6.34, y1 = 52.14, x2 = -5.52, y2 = 50.29, distance = TRUE)
	plotProfile(tr)

# Example 2: 
	layout(matrix(1:2,nc=1),height=c(2,1))
	par(mar=c(4,4,1,1))
	plot(celt,n=40,draw=TRUE)
	points(c(-5,-6.34),c(49.8,52.14),type="o",col=2)
	
	tr2 <- get.transect(celt, x1 = -5, y1 = 49.8, x2 = -6.34, y2 = 52.14, distance = TRUE)
	plotProfile(tr2)

# Example 3: click several times on the map and press ESC
if (FALSE) {
	layout(matrix(1:2,nc=1),height=c(2,1))
	par(mar=c(4,4,1,1))
	data(florida)
	plot(florida,image=TRUE,dra=TRUE,land=TRUE,n=40)
	
	out <- path.profile(as.data.frame(locator(type="o",col=2,pch=19,cex=.8)),florida)
	plotProfile(out)
}

Run the code above in your browser using DataLab