Learn R Programming

isopleuros (version 1.4.0)

ternary_points: Add Points to a Ternary Plot

Description

Add Points to a Ternary Plot

Usage

ternary_points(x, y, z, ...)

# S4 method for numeric,numeric,numeric ternary_points(x, y, z, center = FALSE, scale = FALSE, type = "p", ...)

# S4 method for ANY,missing,missing ternary_points(x, center = FALSE, scale = FALSE, type = "p", ...)

Value

ternary_points() is called it for its side-effects. Invisibly returns a list with the components:

xA numeric vector of x values.
yA numeric vector of y values.
zA numeric vector of z values.
centerA numeric vector giving the center.
scaleA numeric vector giving the scale factor.

Arguments

x, y, z

A numeric vector giving the x, y and z ternary coordinates of a set of points. If y and z are missing, an attempt is made to interpret x in a suitable way (see grDevices::xyz.coords()).

...

Further graphical parameters (see graphics::par()) may also be supplied as arguments, particularly, plotting character, pch, character expansion, cex and color, col.

center

A logical scalar specifying wether the data should be centered, or a numeric vector giving the center.

scale

A logical scalar specifying wether the data should be scaled, or a numeric vector giving the scale factor.

type

A character string indicating the type of plotting; actually any of the types as in graphics::plot.default().

Author

N. Frerebeau

See Also

graphics::points()

Other geometries: ternary_arrows(), ternary_crosshairs(), ternary_image(), ternary_labels(), ternary_lines(), ternary_polygon(), ternary_segments(), ternary_text()

Examples

Run this code
## Add points
## Data from Aitchison 1986
ternary_plot(NULL, panel.first = ternary_grid())
ternary_points(lava, col = "red", pch = 16)

## Center and scale
ternary_plot(NULL, axes = FALSE, frame.plot = TRUE)
ternary_points(lava, col = "red", pch = 16)
ternary_points(lava, center = TRUE, col = "blue", pch = 16)
ternary_points(lava, center = TRUE, scale = TRUE, col = "green", pch = 16)

Run the code above in your browser using DataLab