Learn R Programming

patchwork (version 0.0.1)

wrap_elements: Wrap arbitrary graphics in a patchwork-compliant cell

Description

In order to add non-ggplot2 element to a patchwork assemble they can be converted to a compliant representation using the wrap_elements() function. This allows you to position either grobs, ggplot objects, or ggassemble objects in either the full area, the full plotting area (anything between and including the axis label), or the panel area (only the actual area where data is drawn). Further you can still add title, subtitle, tag, and caption using the same approach as with normal ggplots (using ggtitle() and labs()) as well as styling using theme(). For the latter, only the theme elements targeting plot margins and background as well as title, subtitle, etc styling will have an effect. If a ggassemble or ggplot object is wrapped, it will be fixated in its state and will no longer respond to addition of styling, geoms, etc..

Usage

wrap_elements(panel = NULL, plot = NULL, full = NULL, clip = TRUE,
  ignore_tag = FALSE)

Arguments

panel, plot, full

A grob, ggplot, or ggassemble object to add to the respective area.

clip

Should the grobs be clipped if expanding outside its area

ignore_tag

Should tags be ignored for this cell. This is relevant when using automatic tagging of plots and the content of the cell does not qualify for a tag.

Value

An el_wrapper object