powered by
Plot a digital elevation profile based on xyz data
plot_dz( d, z, fill = TRUE, horiz = FALSE, pal = colorspace::diverging_hcl, ..., legend_position = "top", col = "black", cex = 0.9, bg = grDevices::rgb(1, 1, 1, 0.8), title = "Slope colors (percentage gradient)", brks = c(3, 6, 10, 20, 40, 100), seq_brks = NULL, ncol = 4 )
A plot is created on the current graphics device.
Cumulative distance
Elevations at points across a linestring
Should the profile be filled? TRUE by default
TRUE
Should the legend be horizontal (FALSE by default)
FALSE
Color palette to use, colorspace::diverging_hcl by default.
colorspace::diverging_hcl
Additional parameters to pass to legend
The legend position. One of "bottomright", "bottom", "bottomleft", "left", "topleft", "top" (the default), "topright", "right" and "center".
Line colour, black by default
Legend size, 0.9 by default
Legend background colour, grDevices::rgb(1, 1, 1, 0.8) by default.
grDevices::rgb(1, 1, 1, 0.8)
Title of the legend, "Slope colors (percentage gradient)" by default.
Breaks in colour palette to show. c(3, 6, 10, 20, 40, 100) by default.
c(3, 6, 10, 20, 40, 100)
Sequence of breaks to show in legend. By default this is calculated from brks.
brks
Number of columns in legend, 4 by default.
This function is called by plot_slope() but can be used directly.
plot_slope()
library(sf) route_xyz = lisbon_road_segment_3d m = st_coordinates(route_xyz) d = cumsum(sequential_dist(m, lonlat = FALSE)) d = c(0, d) z = m[, 3] plot_dz(d, z, brks = c(3, 6, 10, 20, 40, 100))
Run the code above in your browser using DataLab