if (FALSE) {
####### 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
GETXprofile(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