Skip to contents

Apply color shading to the mask of a 3d topographic surface.

Usage

x3p_shade_mask(
  x3p,
  colors = rev(c("#b12819", "#d7301f", "#e16457", "#ffffff", "#5186a2", "#175d82",
    "#134D6B")),
  freqs = c(0, 0.05, 0.25, 0.45, 0.55, 0.75, 0.95, 1)
)

Arguments

x3p

object containing a 3d topographic surface

colors

vector of colors

freqs

vector of values corresponding to color frequency (turned into quantiles of the differenced values)

Value

x3p object with color-shaded mask

Examples

if (FALSE) {
data(wire)
x3p <- wire
x3p_image(x3p, size = c(400, 400), zoom=0.8)
x3p_with <- x3p %>% x3p_shade_mask()
x3p_image(x3p_with, size = c(400, 400), zoom=0.8)

data(lea)
lea %>% x3p_shade_mask() %>% x3p_image()
lea %>% x3p_shade_mask(freqs = c(0, 0.05, 0.1, 0.3,0.7, 0.9, 0.95, 1)) %>% x3p_image()
}