dot-SetRegion: Set plotting region

.SetRegionR Documentation

Set plotting region

Description

Sets the region of the ternary plot being drawn. Usually called from within TernaryPlot(); everyday users are unlikely to need to call this function directly.

Usage

.SetRegion(region, prettify = NA_integer_, set = TRUE)

Arguments

region

(optional) Named list of length two specifying the the minimum and maximum values of each ternary axis to be drawn (e.g. ⁠list(min = c(40, 0, 0), max = c(100, 60, 60)⁠); or a set of coordinates in a format accepted by TernaryPoints(). The plotted region will correspond to the smallest equilateral triangle that encompasses the specified ranges or coordinates.

prettify

If numeric, the plotting region will be expanded to allow grid lines to be produced with pretty(n = prettify). If NA, the smallest region encompassing region will be used.

set

Logical specifying whether to set options(ternRegion = region)

Value

.SetRegion() returns the value of options(ternRegion = region) if set == TRUE, or the region, otherwise..

Author(s)

Martin R. Smith (martin.smith@durham.ac.uk)

Examples

# XY Coordinates under original plotting region
TernaryToXY(c(1, 2, 3))
previous <- .SetRegion(rbind(min = c(20, 20, 20), max = c(60, 60, 60)))

# New region options set
getOption("ternRegion")

# Coordinates under new plotting region
TernaryToXY(c(1, 2, 3))

# Restore previous setting
options(previous)
getOption("ternRegion")

ms609/Ternary documentation built on March 10, 2024, 12:11 p.m.