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
function
that takes three arguments (x, y and z coordinates) and returns anumeric
vector.- ...
Further parameters to be passed to
f
.- n
A length-one
integer
vector specifying the maximum number of tiles on each axis.- palette
A
function
that takes a singlenumeric
vector (the output off
) as argument and returns a vector of color. IfNULL
, the default color scheme will be used. IfFALSE
, the output off
is 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)