Learn R Programming

ggtern (version 3.5.0)

theme_showgrid: Show or Hide Grid

Description

A set of convenience functions to enable or disable the use of major or minor (or both) gridlines.

Usage

theme_showgrid()

theme_hidegrid()

theme_nogrid()

theme_tern_nogrid()

theme_showgrid_major()

theme_hidegrid_major()

theme_nogrid_major()

theme_tern_nogrid_major()

theme_showgrid_minor()

theme_hidegrid_minor()

Arguments

Author

Nicholas Hamilton

Details

These flags operate at the 'rendering' level, and, supercede the presence of theme elements, therefore,

theme_hidegrid(...) or its aliases will PREVENT rendering of grid elements, irrespective of whether those grid elements are valid (renderable). From the counter perspective,

theme_showgrid(...) or its aliases will ALLOW rendering of grid elements, subject to those grid elements being valid (renderable, ie say element_line as opposed to element_blank).

theme_hidegrid or theme_nogrid (alias) is a function which disables both MAJOR and MINOR gridlines.

theme_showgrid_major is a function which enables MAJOR gridlines.

theme_hidegrid_major or theme_nogrid_major (alias) is a function which disables MAJOR gridlines.

theme_showgrid_major is a function which enables MINOR gridlines.

theme_hidegrid_minor or theme_nogrid_minor (alias) is a function which disables MINOR gridlines.

theme_showgrid is a function which enables both MAJOR and MINOR gridlines.

Examples

Run this code
  #Load data
  data(Feldspar)
  plot <- ggtern(data=Feldspar,aes(Ab,An,Or)) + 
          geom_point()   + #Layer 
          theme_bw()       #For clarity
  plot
  plot = plot + theme_hidegrid(); plot
  plot + theme_showgrid()

Run the code above in your browser using DataLab