Learn R Programming

patchwork (version 0.0.1.9000)

cell: Specify a plotting area in a layout

Description

This is a small helper used to specify a single area in a rectangular grid that should contain a plot. Objects constructed with cell() can be concatenated together with c() in order to specify multiple areas.

Usage

cell(t, l, b = t, r = l)

Arguments

t, b

The top and bottom bounds of the area in the grid

l, r

The left and right bounds of the area int the grid

Value

A plot_cell object

Details

The grid that the cells are specified in reference to enumerate rows from top to bottom, and coloumns from left to right. This means that t and l should always be less or equal to b and r respectively. Instead of specifying cell placement with a combination of cell() calls, it is possible to instead pass in a single string

cells <- c(cell(1, 1, 2, 1),
           cell(2, 3, 3, 3))

is equivalent to

cells < -"A##
          A#B
          ##B"

For an example of this, see the plot_layout() examples.