draw_subcatchments_OCN: Draw subcatchment map from an Optimal Channel Network

Description Usage Arguments Value Examples

View source: R/draw_subcatchments_OCN.R

Description

Function that draws a map of subcatchments generated by the aggregation process on the OCN.

Usage

1
draw_subcatchments_OCN(OCN, drawRiver = TRUE, colPalette = NULL)

Arguments

OCN

List as produced by aggregate_OCN.

drawRiver

if TRUE, draw the OCN on top of the subcatchment map.

colPalette

Color palette used. Default is c("#009900", "#FFFF00", "#FF9900", "#FF0000", "#FF00FF", "#9900CC", "#555555", "#BBBBBB"). Only the first n colors are used, where n is the number of different colors needed (calculated via a greedy coloring algorithm). colPalette accepts both functions creating color palettes and vectors of colors (see examples); in the latter case, the length of the vector cannot be lower than n (n cannot be predicted a priori, but generally 6 colors should suffice).

Value

No output is returned.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# 1a) aggregate a 20x20 OCN , use thrA = 5 pixels
# and draw subcatchments with default color palette
OCN <- aggregate_OCN(landscape_OCN(OCN_20), thrA = 5)
draw_subcatchments_OCN(OCN, drawRiver = TRUE)

# 1b) same as above, but define color palette with a function
draw_subcatchments_OCN(OCN, drawRiver = TRUE, colPalette = rainbow)

# 1c) same as above, but define color palette with a vector of colors
draw_subcatchments_OCN(OCN, drawRiver = TRUE, colPalette = hcl.colors(6, "Dark 3"))

OCNet documentation built on May 17, 2021, 5:07 p.m.