This function is almost exactly the same as the ternaryplot
function in package vcd
(on which it is based) except that the ordering of the vertices has been change to bottom left/top/bottom right, and the code has been extended work for an aribtrary scoring matrix L
.
tplot(x = cbind(1, 1, 1)/3, L = diag(c(1, 1, 1))/sqrt(2),
scale = 1, dimnames = NULL,
dimnames_position = c("corner", "none"),
dimnames_color = "black", id = NULL, id_color = "black",
coordinates = FALSE, grid = TRUE, grid_color = "gray",
labels = c("inside", "outside", "none"),
labels_color = "darkgray", border = "grey",
bg = "white", pch = 19, cex = 1, prop_size = FALSE,
col = "red", main = "ternary plot", sub = NULL,
newpage = TRUE, pop = TRUE, col.main = "black",
col.sub = "black", ...)
an n-by-3 matrix of ternary forecasts.
A matrix describing the quadratic score function. (Default corresponds to the Brier score).
row sums scale to be used.
dimension labels (defaults to the column names of x
.
position and color of dimension labels.
optional labels to be plotted below the plot symbols. coordinates
and id
are mutually exclusive.
color of these labels.
if TRUE
, the coordinates of the points are plotted below them. coordinates
and id
are mutually exclusive.
if TRUE
, a grid is plotted. May optionally be a string indicating the line type (default: "dotted"
).
grid colour.
position and colour of the grid labels.
colour of the triangle border.
triangle background.
plotting character. Defaults to filled dots.
a numerical value giving the amount by which plotting text and symbols should be scaled relative to the default. Ignored for the symbol size if prop_size
is not FALSE
.
if TRUE
, the symbol size is plotted proportional to the row sum of the three variables, i.e., represents the weight of the observation.
plotting colour.
main title.
a sub title.
if `TRUE', the plot will appear on a new graphics page.
logical; if `TRUE', all newly generated viewports are popped after plotting.
colour for the title.
colour for the sub title.
additional graphics parameters (see par
).
Tim Jupp (using code for vcd:ternaryplot
as source).
tg <- tgrid(6) # make a grid of forecasts in the triangle
tg # print to terminal
tplot(tg) # plot them
Run the code above in your browser using DataLab