Creates a grid of colored triangles with colors corresponding to the output of a function.
Usage
ternary_image(f, ...)
# S4 method for class 'function'
ternary_image(f, n = 48, palette = NULL, ...)Arguments
- f
A
functionthat takes three arguments (x, y and z coordinates) and returns anumericvector (seetile_bin(),tile_density(),tile_interpolate()).- ...
Further parameters to be passed to
f.- n
A length-one
integervector specifying the maximum number of tiles on each axis.- palette
A
functionthat takes a singlenumericvector (the output off) as argument and returns a vector of color. IfNULL, the default color scheme will be used. IfFALSE, the output offis used as colors.
See also
Other geometries:
ternary_arrows(),
ternary_crosshairs(),
ternary_labels(),
ternary_lines(),
ternary_points(),
ternary_polygon(),
ternary_segments(),
ternary_text()
Examples
## RGB
ternary_plot(NULL, xlab = "Red", ylab = "Green", zlab = "Blue")
ternary_image(f = rgb, n = 20, palette = FALSE)
