RPMG (version 2.2-2)

aGETXprofile: Cross sectional profile through a digital elevation map

Description

Example of how to use RPMG button functions. This example shows how to plot a DEM and interactively change the plot and find projected cross-sections through a surface.

Usage

aGETXprofile(jx, jy, jz, LAB = "A", myloc = NULL, PLOT = FALSE, asp=1)

Arguments

jx, jy

locations of grid lines at which the values in 'jz' are measured.

jz

a matrix containing the values to be plotted

LAB

Alphanumeric (A-Z) for labeling a cross section

myloc

Out put of Locator function

PLOT

logical. Plot is created if TRUE

asp

aspect ration, see par

Value

Returns a list of x,z values representing the projected values along the cross section.

RX

distance along cross section

RZ

values extracted from the elevation map

Details

The program uses a similar input format as image or contour, with structure from the locator() function of x and y coordinates that determine where the cross section is to be extracted.

See Also

locator, image

Examples

Run this code
# NOT RUN {
#######  get data 
   data(volcano)
####  extract dimensions of image
   nx = dim(volcano)[1]
   ny = dim(volcano)[2]

###  establish units of image
   jx = 10*seq(from=0, to=nx-1)
   jy = 10*seq(from=0, to=ny-1)

####  set a letter for the cross section
   LAB = LETTERS[1]

###  coordinates of cross section on image
###  this is normally set by using the locator() function
   x1 = 76.47351
   y1 = 231.89055
   x2 = 739.99746
   y2 = 464.08185

## extract and plot cross section

 aGETXprofile(jx, jy, volcano, myloc=list(x=c(x1, x2), y=c(y1, y2)), LAB=LAB, PLOT=TRUE)
# }

Run the code above in your browser using DataLab