powered by
Plots topographic cross sections (elevation profiles) of topographic paths
topoProfile( DEM, topoPaths, pts = 100, type = "base", singlePlot = FALSE, rows = NULL, cols = NULL, limits = NULL, legendx = "bottomright" )
Plot of elevation profiles
A RasterLayer for digital elevation model (DEM) data.
A SpatialLines object containing the topographic paths to be plotted.
numeric (default = 100). The number of elevation points to plot along each path.
character (default = "base"). Type of plotting: "base" or "plotly".
logical (default = FALSE). If TRUE, profiles will be drawn on a single plot.
numeric (optional). Number of rows for plot layout (if singlePlot = FALSE)
numeric (optional). Number of columns for plot layout (if singlePlot = FALSE)
numeric vector (optional). A vector with the lower and upper limits for the y-axis (elevation).
character (default = "bottomright"). Position for the legend.
For the type argument, choosing "base" will use base R plotting, and choosing "plotly" will draw an interactive plot with the plotly package.
If rows, cols, or limits are not specified, the most even arrangement will be detected and used.
xy <- matrix(ncol = 2, byrow = TRUE, c(-119.5566, 37.7247, -119.4718, 37.7608)) YosPaths <- topoDist(Yosemite$DEM, xy, paths = TRUE) topoProfile(Yosemite$DEM, topoPaths = YosPaths)
Run the code above in your browser using DataLab