Description Usage Arguments Examples
Generic ternary-data plotting
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, ...)
|
s |
Either a character string naming the ternary classification
system to be used (if pre-defined) or a
|
x |
A |
scale |
Either a logical value or a |
... |
Additional parameters passed to specific methods. |
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 )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.