Adds a triangular grid to an existing plot.
Arguments
- primary
An
integer
specifying the number of cells of the primary grid inx
,y
andz
direction.- secondary
An
integer
specifying the number of cells of the secondary grid inx
,y
andz
direction.- center
A
numeric
vector giving the center. IfNULL
(the default), data are assumed not centered.- scale
A
numeric
vector giving the scale factor. IfNULL
(the default), data are assumed not scaled.- col.primary, col.secondary
A
character
string specifying the color of the grid lines.- lty.primary, lty.secondary
A
character
string ornumeric
value specifying the line type of the grid lines.- lwd.primary, lwd.secondary
A non-negative
numeric
value specifying the line width of the grid lines.
See also
Other graphical elements:
ternary_axis()
,
ternary_box()
,
ternary_pairs()
,
ternary_plot()
,
ternary_title()
Examples
## Data from Aitchison 1986
ternary_plot(lava, center = FALSE, scale = FALSE, col = "red", pch = 16)
ternary_grid(5)
## Center
z <- ternary_plot(lava, center = TRUE, col = "blue", pch = 16)
ternary_grid(5, center = z$center)
## Center and scale
z <- ternary_plot(lava, center = TRUE, scale = TRUE, col = "green", pch = 16)
ternary_grid(5, center = z$center, scale = z$scale)