ternaryPlot-methods: Generic ternary-data plotting

Description Usage Arguments Examples

Description

Generic ternary-data plotting

Usage

1
2
3
4
5
6
7
ternaryPlot(s, ...)

## S3 method for class 'character'
ternaryPlot(s, ...)

## S3 method for class 'ternarySystem'
ternaryPlot(s, x = NULL, scale = FALSE, ...)

Arguments

s

Either a character string naming the ternary classification system to be used (if pre-defined) or a ternarySystem object.

x

A data.frame or a matrix containing point ternary data (x-y-x) to be ploted on the graph. It should contain the 3 columns names given in s. If missing, only the ternary classification is drawn.

scale

Either a logical value or a data.frame with 3 columns and 2 rows. If TRUE, the triangle plot will be scaled to fit the data. If FALSE, no scaling is performed, and the full extent triangle plot is drawn. If a data.frame, contains the min and max limits of each of the 3 variables (columns = variables, rows = min and max).

...

Additional parameters passed to specific methods.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
library( "ternaryplot" ) 


# Split the window in 4 sub-plots
# -------------------------------

#   Save and then set graphical parameters
op <- par( no.readonly = TRUE ) 
par( mfrow = c(2,2), cex = .5 )

# par( mar = c(3,2,0,2)+.1 ) # for larger triangles


# Default ternary plot
# ====================

s <- ternaryPlot() 


# Change axis orientation (clockwise vs counter-clockwise)
# ========================================================

# Set new orientation
blrClock( s ) <- rep( FALSE, 3 ) 

# Plot
ternaryPlot(s) 


# Change axis orientation and frame angles
# ========================================

# Set new orientation and angles
blrClock( s )  <- c( FALSE, TRUE, NA ) 
tlrAngles( s ) <- c( 45, 90, 45 ) 

# Plot
ternaryPlot(s) 


# Same, other direction
# =====================

blrClock( s ) <- c( TRUE, NA, FALSE ) 
tlrAngles( s ) <- c(45,45,90) 

ternaryPlot(s) 


# reset par
par( op )


# Custom colors
# =============

#   Set general graphical parameters (enlarged plot)
par( fg = "darkred", col.lab = "darkblue", mar = c(3,2,0,2)+.1 ) 
    # mar = c(bottom, left, top, right) 

#   Set specific graphical parameters
tpPar( grid.line.col = "white", arrowsBreak = FALSE, 
    plot.bg = gray( .95 ) )

ternaryPlot()


# reset par
par( op )
tpPar( reset = TRUE )

ternaryplot documentation built on May 2, 2019, 6:11 p.m.