TernaryPlot(alab = "a", blab = "b", clab = "c")
FunctionToContour <- function (a, b, c) {
a - c + (4 * a * b) + (27 * a * b * c)
}
values <- TernaryPointValues(FunctionToContour, resolution = 24L)
ColourTernary(
values,
x = "topleft",
bty = "n", # No box
legend = signif(seq(max(values), min(values), length.out = 4), 3)
)
TernaryContour(FunctionToContour, resolution = 36L)
TernaryPlot()
values <- TernaryPointValues(rgb, resolution = 20)
ColourTernary(values, spectrum = NULL)
# Create a helper function to place white centrally:
rgbWhite <- function (r, g, b) {
highest <- apply(rbind(r, g, b), 2L, max)
rgb(r/highest, g/highest, b/highest)
}
TernaryPlot()
values <- TernaryPointValues(rgbWhite, resolution = 20)
ColourTernary(values, spectrum = NULL)
Run the code above in your browser using DataLab