themeCollapse: Set the 'ggplot2' theme to remove all marginal space.

theme_collapseR Documentation

Set the ggplot2 theme to remove all marginal space.

Description

Set the ggplot2 theme to remove all marginal space. By default the grid, ticks, tick labels, and axis labels are set to blank. Margins are set to 0.

Usage

  theme_collapse(      ## the commented values are from theme_grey
  panel.grid.major=eb, ## element_line(colour = "white")
  panel.grid.minor=eb, ## element_line(colour = "white", size = 0.25)
  axis.ticks=eb,       ## element_line(colour = "grey20")
  axis.text=eb,        ## element_text(size = rel(0.8), colour = "grey30")
  axis.title=eb,       ## axis.title.x = element_text(
                       ##    margin = margin(t = 0.8 * half_line,
                       ##                    b = 0.8 * half_line/2))
                       ## axis.title.y = element_text(angle = 90,
                       ##    margin = margin(r = 0.8 * half_line,
                       ##                    l = 0.8 * half_line/2))
  plot.margin= grid::unit(c(0, 0, 0, 0), "in"),
  ...,
  eb=ggplot2::element_blank())

Arguments

panel.grid.major, panel.grid.minor, axis.ticks, axis.text, axis.title, plot.margin

ggplot2 theme elements. See theme for information.

...

Other valid arguments to ggplot2::theme.

eb

Convenience for ggplot2::element_blank().

Details

When very small plots are placed inside a LaTeX tabular environment, it is often helpful to suppress margins, axes, labels, titles.

Value

A ggplot2 theme object.

Note

The first draft of theme_collapse was written by Karen Byron.

Author(s)

Richard M. Heiberger <rmh@temple.edu>

Examples

theme_collapse()
## Please see the package documentation for a simple example in context.

## Please see the demos for more interesting examples.
## demo(package="microplot")

microplot documentation built on March 18, 2022, 7:56 p.m.