topoProfile | R Documentation |
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" )
DEM |
A RasterLayer for digital elevation model (DEM) data. |
topoPaths |
A SpatialLines object containing the topographic paths to be plotted. |
pts |
numeric (default = 100). The number of elevation points to plot along each path. |
type |
character (default = "base"). Type of plotting: "base" or "plotly". |
singlePlot |
logical (default = FALSE). If TRUE, profiles will be drawn on a single plot. |
rows |
numeric (optional). Number of rows for plot layout (if singlePlot = FALSE) |
cols |
numeric (optional). Number of columns for plot layout (if singlePlot = FALSE) |
limits |
numeric vector (optional). A vector with the lower and upper limits for the y-axis (elevation). |
legendx |
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.
Plot of elevation profiles
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.