ggtern themes

Description

Themes set the general aspect of the plot such as the colour of the background, gridlines, the size and colour of fonts.

Details

theme_gray
The signature ggplot2 theme with a grey background and white gridlines, designed to put the data forward yet make comparisons easy.

theme_bw
The classic dark-on-light ggplot2 theme. May work better for presentations displayed with a projector.

theme_linedraw
A theme with only black lines of various widths on white backgrounds, reminiscent of a line drawings. Serves a purpose similar to theme_bw. Note that this theme has some very thin lines (<< 1 pt) which some journals may refuse.

theme_light
A theme similar to theme_linedraw but with light grey lines and axes, to direct more attention towards the data.

theme_dark
The dark cousin of theme_light, with similar line sizes but a dark background. Useful to make thin coloured lines pop out.

theme_darker
A darker cousing to theme_dark, with a dark panel background.

theme_minimal
A minimalistic theme with no background annotations.

theme_classic
A classic-looking theme, with x and y axis lines and no gridlines.

theme_rgbw
A theme with white background, red, green and blue axes and gridlines

theme_rgbg
A theme with grey background, red, green and blue axes and gridlines

theme_void
A completely empty theme.

theme_custom
Theme with custom basic colours

theme_matrix
Theme with very dark background and bright green features

theme_tropical
Theme with tropical colours

theme_bluelight
A blue theme with light background and dark features

theme_bluedark
A blue theme with dark background and light features

theme_bvbw
A black/vermillion/blue theme with white background, for colorblind sensitive readers, see references.

theme_bvbg
A black/vermillion/blue theme with grey background, for colorblind sensitive readers, see references.

References

Okabe, Masataka, and Kei Ito. "How to make figures and presentations that are friendly to color blind people." University of Tokyo (2002). http://jfly.iam.u-tokyo.ac.jp/color/

Usage

theme_ggtern(base_size = 11, base_family = "")
theme_gray(base_size = 11, base_family = "")
theme_bw(base_size = 12, base_family = "")
theme_linedraw(base_size = 12, base_family = "")
theme_light(base_size = 12, base_family = "")
theme_minimal(base_size = 12, base_family = "")
theme_classic(base_size = 12, base_family = "")
theme_dark(base_size = 12, base_family = "")
theme_void(base_size = 12, base_family = "")
theme_darker(base_size = 12, base_family = "")
theme_custom(base_size = 12, base_family = "", tern.plot.background = NULL, tern.panel.background = NULL, col.T = "black", col.L = "black", col.R = "black", col.grid.minor = "white")
theme_rgbw(base_size = 12, base_family = "")
theme_rgbg(base_size = 12, base_family = "")
theme_matrix(base_size = 12, base_family = "")
theme_tropical(base_size = 12, base_family = "")
theme_bluedark(base_size = 12, base_family = "")
theme_bluelight(base_size = 12, base_family = "")
theme_bvbw(base_size = 12, base_family = "")
theme_bvbg(base_size = 12, base_family = "")

Arguments

base_size
base font size
base_family
base font family
tern.plot.background
colour of background colour to plot area
tern.panel.background
colour of panel background of plot area
col.T
colour of top axis, ticks labels and major gridlines
col.L
colour of left axis, ticks, labels and major gridlines
col.R
colour of right axis, ticks, labels and major gridlines
col.grid.minor
the colour of the minor grid theme_custom is a convenience function to allow the user to control the basic theme colours very easily.

Examples

#Create a list of the theme suffixes themesOrg = c('gray','bw','linedraw','light', 'dark','minimal','classic','void') themesNew = c('custom','darker','rgbw','rgbg','tropical', 'matrix','bluelight','bluedark','bvbw','bvbg') #Iterate over all the suffixes, creating a list of plots plotThemes = function(themes){ grobs = lapply(themes,function(x){ thmName = sprintf("theme_%s",x) thm = do.call(thmName,args=list(base_size=9)) df = data.frame(label=thmName) ggtern(df) + facet_wrap(~label) + thm }) grobs } #Arrange the Original Themes grid.arrange(grobs=plotThemes(themesOrg),top = "Collection of Themes (Original)")

#Arrange the New Themes grid.arrange(grobs=plotThemes(themesNew),top = "Collection of Themes (New Themes)")