Learn R Programming

ggtern (version 2.1.4)

convenience_functions: Theme Convenience Functions

Description

ggtern has made available a number of convenience functions for rapid tweaking of the various theme elements, for a full list of the available theme elements which can be manually modified, see HERE.

Arguments

Manual Modification

For manual modification on a per-element basis:

Default Themes

Default (complete) themes which ship with ggtern:

Examples

Run this code

#Load data and create the base plot.
plot <- ggtern(data=data.frame(x=1,y=1,z=1),aes(x,y,z)) + geom_point() + theme_bw()
plot

#Show or Hide Arrows
last_plot() + theme_showarrows()
#last_plot() + theme_hidearrows()

#Major/Minor Grids?
last_plot() + theme_nogrid_minor()
#last_plot() + theme_nogrid_major()
#last_plot() + theme_showgrid()
#last_plot() + theme_nogrid()

#Clockwise/Anticlockwise Precession
last_plot() + theme_clockwise()
#last_plot() + theme_anticlockwise()

#Ticks Inside or Outside
last_plot() + theme_ticksoutside()
#last_plot() + theme_ticksinside()

#Show/Hide BOTH Primary and Secondary Ticks
last_plot() + theme_showticks()
#last_plot() + theme_hideticks()

#Show/Hide EITHER Primary OR Secondary Ticks.
last_plot() + theme_showprimary() + theme_hidesecondary()
#last_plot() + theme_hideprimary() + theme_showsecondary()

#Atomic / Weight Percent
last_plot() + theme_showarrows() + atomic_percent()
#last_plot() + theme_showarrows() + weight_percent()
#last_plot() + theme_showarrows() + custom_percent("Atomic Percent")

#Rotation
last_plot() + theme_rotate(30)

Run the code above in your browser using DataLab