theme_arrowlength: Change the Length of the Ternary Arrows

theme_arrowlengthR Documentation

Change the Length of the Ternary Arrows

Description

A set of convenience functions to rapidly change the length of the ternary arrows, the convenience functions include presets (short, normal, long), or makes provision for the user to specify custom fractional starting and ending values relative to the size of the ternary axis. In the event that the user elects to specify the values via the theme_arrowcustomlength (or its aliasses), then the user can specify a single scalar value which apply to all three (3) arrows, or, alternatively, can provide a numeric vector of length three (3), one for each arrow respectively.

Usage

theme_arrowcustomlength(
  start = getOption("tern.arrow.start"),
  finish = getOption("tern.arrow.finish")
)

theme_arrowlength(
  start = getOption("tern.arrow.start"),
  finish = getOption("tern.arrow.finish")
)

theme_arrowsmall()

theme_arrowshort()

theme_arrownormal()

theme_arrowdefault()

theme_arrowlarge()

theme_arrowlong()

Arguments

start

a numeric scalar, or numeric vector of length three (3), representing the fractional [0,1] position along the axis where the arrow/s should START.

finish

a numeric scalar, or numeric vector of length three (3), representing the fractional [0,1] position along the axis where the arrow/s should FINISH.

Details

If the ternary arrows are switched OFF (via the theme_hidearrows command, or the theme(tern.axis.arrow.show=FALSE) theme element), then under such circumstance, these convenience functions will turn ON the ternary arrows, essentially running theme_showarrows or theme(tern.axis.arrow.show=TRUE)

If for some reason, the start and finish arguments are identical, then the ternary arrows will be switched OFF, tantamount to running the theme_hidearrows convenience function.

Custom Length

theme_arrowcustomlength or theme_arrowlength (alias) sets the ternary arrow lengths to values as specified by the user, occupying a length between the values as specified by the start and finish arguments (fractions) relative to the length of the ternary axis.

Short Arrow Length

theme_arrowsmall or theme_arrowshort(alias) reduces the ternary arrows to short arrows, occupying a length between 0.4 and 0.6 of the length of the ternary axis

Normal/Default Arrow Length

theme_arrownormal or theme_arrowdefault(alias) reduces the ternary arrows to normally sized arrows, occupying a length between getOption("tern.arrow.start") and getOption("tern.arrow.finish") global option values, whatever they may be.

Long Arrow Length

theme_arrowlarge or theme_arrowlong(alias) increases the ternary arrows to long arrows occupying a length between 0.2 and 0.8 of the length of the ternary axis

Author(s)

Nicholas Hamilton

See Also

theme_arrowbaseline and theme(tern.axis.arrow.sep=X) for methods to adjust the separation distance of the ternary arrows from the ternary axes.

Examples

 #Create base plot
 plot <- ggtern(data=data.frame(x=1,y=1,z=1),aes(x,y,z)) + geom_point()

 #Pre-Specified Values
 plot + theme_arrowsmall()
 
 ## Alternatives, Uncomment lines below
 plot + theme_arrownormal()
 plot + theme_arrowlarge()
 plot + theme_arrowcustomlength(.1,.8)
 plot + theme_arrowlength(start=c(.1,.25,.4),finish=c(.9,.75,.6))

ggtern documentation built on June 22, 2024, 11:01 a.m.