tplot {ternvis}R Documentation

Plot ternary forecasts in barycentric coordinates.

Description

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.

Usage

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", ...)

Arguments

x

an n-by-3 matrix of ternary forecasts.

L

A matrix describing the quadratic score function. (Default corresponds to the Brier score).

scale

row sums scale to be used.

dimnames

dimension labels (defaults to the column names of x.

dimnames_position, dimnames_color

position and color of dimension labels.

id

optional labels to be plotted below the plot symbols. coordinates and id are mutually exclusive.

id_color

color of these labels.

coordinates

if TRUE, the coordinates of the points are plotted below them. coordinates and id are mutually exclusive.

grid

if TRUE, a grid is plotted. May optionally be a string indicating the line type (default: "dotted").

grid_color

grid colour.

labels, labels_color

position and colour of the grid labels.

border

colour of the triangle border.

bg

triangle background.

pch

plotting character. Defaults to filled dots.

cex

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.

prop_size

if TRUE, the symbol size is plotted proportional to the row sum of the three variables, i.e., represents the weight of the observation.

col

plotting colour.

main

main title.

sub

a sub title.

newpage

if ‘TRUE’, the plot will appear on a new graphics page.

pop

logical; if ‘TRUE’, all newly generated viewports are popped after plotting.

col.main

colour for the title.

col.sub

colour for the sub title.

...

additional graphics parameters (see par).

Author(s)

Tim Jupp (using code for vcd:ternaryplot as source).

Examples

tg <- tgrid(6) # make a grid of forecasts in the triangle
tg             # print to terminal
tplot(tg)      # plot them

[Package ternvis version 1.2 Index]