plotPlusMatrix: function to generate an aligned set of (maximum 4) plots as a...

View source: R/generalStat.R

plotPlusMatrixR Documentation

function to generate an aligned set of (maximum 4) plots as a 2x2 matrix (2 columns, 2 rows)

Description

function to generate an aligned set of (maximum 4) plots as a 2x2 matrix (2 columns, 2 rows)

Usage

plotPlusMatrix(
  sPlot,
  xPlot = clearPlot(),
  yPlot = clearPlot(),
  crossPlot = clearPlot(),
  widths = c(125, 875),
  heights = c(875, 125)
)

Arguments

sPlot

ggplot object to be placed in top, right corner

xPlot

ggplot object to be placed in bottom, right corner (along x-axis of sPlot object)

yPlot

ggplot object to be placed in top, left corner (along y-axis of sPlot object)

crossPlot

ggplot object to be placed in bottom, left corner

widths

horizontal: two number (integer) vector specifying the amount of the plot to be used for the plots (horizontally)

heights

vertical: two number (integer) vector specifying the amount of the plot to be used for the plots (vertically)

Value

a ggplot object

Note

what is returned is grobtable (class gtable): this can be drawn via the grid.draw() function. The plot drawn before this will have to be cleared "manually" via clearPlot()


BenBruyneel/BBPersonalR documentation built on Aug. 23, 2024, 8:28 p.m.