draw_contour_OCN: Draw Optimal Channel Network with catchment contours

Description Usage Arguments Details Value Examples

View source: R/draw_contour_OCN.R

Description

Function that plots real-shaped OCN and catchment contours.

Usage

1
2
3
draw_contour_OCN(OCN, thrADraw = 0.002 * OCN$dimX * OCN$dimY *
  OCN$cellsize^2, exactDraw = TRUE, drawContours = TRUE, colPalRiver = NULL, 
  colPalCont = "#000000", drawOutlets = 0, pch = 15, colPalOut = "#000000")

Arguments

OCN

List as produced by landscape_OCN.

thrADraw

Threshold drainage area value used to display the network.

exactDraw

If TRUE, the real shape of OCNs is plotted. If flow crosses a boundary, the pixel that is not contiguous to its outlet is flipped. It is only effective if OCN$PeriodicBoundaries = TRUE

drawContours

If TRUE, plot catchment(s) contours.

colPalRiver

Color palette used to plot the river network(s). Default is a rearranged version of theme "Dark 3" (see hcl.pals). colPalRiver accepts both functions creating color palettes and vectors of colors (of which the first OCN$nOutlet elements are used). If a single color value is provided and OCN$nOutlet > 1, all river networks are drawn with the same color.

colPalCont

Color palette used to plot the catchment contour(s). Details as in colPalRiver. Additionally, if colPalCont = 0, the palette specified in colPalRiver is copied.

drawOutlets

If equal to 1, black squares are drawn at the outlets' locations behind the river; if 2 they are plotted on top of the river.

pch

Shape of the outlet points (if drawOutlets = TRUE). See points for legend.

colPalOut

Color palette used to plot the outlet points (if drawOutlets = TRUE). Details as in colPalRiver. Additionally, if colPalOut = 0, the palette specified in colPalRiver is copied.

Details

For not too large networks (i.e. if OCN$FD$nNodes <= 40000, corresponding to a 200x200 lattice), pixels whose drainage area OCN$FD$A is lower than thrADraw are drawn with a light grey stroke. If OCN$FD$nNodes > 40000, in order to speed up the execution of this function, only the network constituted by pixels such that OCN$FD$A > thrADraw is drawn.

Value

No output is returned.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 1) draw contour of a 20x20 single-outlet OCN
# (for single-outlet OCNs without periodic boundaries, the output
# of draw_contour_OCN is very similar to that of draw_simple_OCN)
draw_contour_OCN(landscape_OCN(OCN_20), thrADraw = 4)

## Not run: 
# 2a) plot real shape of multiple-outlet OCN created with periodic boundaries
# add outlets on top of the rivers
OCN <- landscape_OCN(OCN_300_4out_PB_hot, displayUpdates = 2) # it takes around one minute
draw_contour_OCN(OCN, drawOutlets = 2)

# 2b) same as before, but use same color palette for rivers and contours
draw_contour_OCN(OCN, colPalCont = 0)

# 2c) draw contours of catchments obtained from an OCN with nOutlet = "All"
OCN <- landscape_OCN(OCN_400_Allout, displayUpdates = 2) # it takes some minutes
draw_contour_OCN(OCN)

# 2d) same as above, but do not plot contours, and plot outlets 
# with same color palette as rivers
draw_contour_OCN(OCN, drawContours = FALSE, drawOutlets = TRUE,
		colPalOut = 0)


## End(Not run)

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