Plot slope data for a 3d linestring with base R graphics
plot_slope( route_xyz, lonlat = sf::st_is_longlat(route_xyz), 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 = seq(from = 3, to = length(brks) * 2 - 2), ncol = 4, ... )
route_xyz | An sf linestring with x, y and z coordinates, representing a route or other linear object. |
---|---|
lonlat | Are the routes provided in longitude/latitude coordinates?
By default, value is from the CRS of the routes ( |
fill | Should the profile be filled? |
horiz | Should the legend be horizontal ( |
pal | Color palette to use, |
legend_position | The legend position. One of "bottomright", "bottom", "bottomleft", "left", "topleft", "top" (the default), "topright", "right" and "center". |
col | Line colour, black by default |
cex | Legend size, 0.9 by default |
bg | Legend background colour, |
title | Title of the legend, |
brks | Breaks in colour palette to show.
|
seq_brks | Sequence of breaks to show in legend. Includes negative numbers and omits zero by default |
ncol | Number of columns in legend, 4 by default. |
... | Additional parameters to pass to legend |
A plot showing the elevation profile associated with a linestring.
plot_slope(lisbon_route_3d)route_xyz = lisbon_road_segment_3d plot_slope(route_xyz)plot_slope(route_xyz, s = 5:8)