layoutCollapse: Set the lattice 'par.settings' to remove all marginal space.

View source: R/layoutCollapse.R

layoutCollapseR Documentation

Set the lattice par.settings to remove all marginal space.

Description

Set the lattice par.settings to remove all marginal space. By default layoutHeightsCollapse and layoutWidthsCollapse set everything in layout.heights or layout.widths to 0 except for panel. The user can specify values for all the standard items in either of those items.
layoutCollapse by default sets layout=c(1,1), collapses to 0 all heights and widths except for panel, removes all labels and strip labels, and sets all axis lines to col="transparent".

Usage


layoutCollapse(x,
               xlab="",
               ylab="",
               xlab.top=NULL,
               ylab.right=NULL,
               main=NULL,
               sub=NULL,
               strip=FALSE,
               strip.left=FALSE,
               layout.heights=layoutHeightsCollapse(),
               layout.widths=layoutWidthsCollapse(),
               strip.border=list(col="transparent"),
               axis.line=list(col="transparent"),
               layout=c(1,1),
               ...)
layoutHeightsCollapse(...)
layoutWidthsCollapse(...)

Arguments

...

For layoutCollapse any argument to update.trellis.

For layoutHeightsCollapse any item name in
trellis.par.get()$layout.heights.

For layoutWidthsCollapse any item name in
trellis.par.get()$layout.widths.

x

Any "trellis" object.

xlab, ylab, xlab.top, ylab.right, main, sub

Standard xyplot arguments.

strip, strip.left, strip.border, axis.line, layout

Standard xyplot arguments.

layout.heights, layout.widths

Arguments to trellis.par.get.

Details

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

Value

For layoutCollapse, a "trellis" object.

For layoutHeightsCollapse and layoutWidthsCollapse, a list which may be used as input to the par.settings argument in a lattice call.

Author(s)

Richard M. Heiberger <rmh@temple.edu>

Examples

## Not run: 
  lattice::trellis.par.get("layout.heights")
  lattice::trellis.par.get("layout.widths")
  layoutHeightsCollapse()
  layoutWidthsCollapse()
  layoutWidthsCollapse(axis.left=1)

  A <- lattice::xyplot(Sepal.Length ~ Sepal.Width | Species, data=iris)

  A                 ## one page with three panels

  layoutCollapse(A) ## three pages with one unlabeled panel on each

  layoutCollapse(A, ## one page with panels labeled by ylab
                 layout=c(1,3),
                 ylab=levels(iris$Species),
                 layout.heights=list(axis.bottom=1),
                 layout.widths=list(axis.left=1),
                 axis.line=list(col="green"))

## End(Not run)

## 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.