Skip to contents

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 a numeric 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 single numeric vector (the output of f) as argument and returns a vector of color. If NULL, the default color scheme will be used. If FALSE, the output of f is used as colors.

Value

ternary_image() is called it for its side-effects.

Author

N. Frerebeau

Examples

## RGB
ternary_plot(NULL, xlab = "Red", ylab = "Green", zlab = "Blue")
ternary_image(f = rgb, n = 20, palette = FALSE)