Learn R Programming

spikeSlabGAM (version 0.9-6)

arrange.ggplots: Arrange multiple ggplots on the same device, trying to align axes etc.

Description

Arrange multiple ggplots on the same device, trying to align axes etc.

Usage

arrange.ggplots(..., rows=as.list(rep(1, length(dots))),
    cols=as.list(1:length(dots)), widths=rep(1,
    max(unlist(rows))), heights=rep(1, max(unlist(cols))),
    align=rep(TRUE, length(dots)))

Arguments

...
ggplot objects
rows
a list with as many entries as there are elements of ..., each list entry can be a scalar or a vector of integers specifying which rows of the grid layout the respective plot is to use. Defaults to a list of 1s, i.e. all the su
cols
a list with as many entries as there are elements of ..., each list entry can be a scalar or a vector of integers specifying which columns of the grid layout the respective plot is to use. Defaults to a list of 1 to lengt
widths
a vector of relative widths for the columns. Defaults to the same width for all columns.
heights
a vector of relative heights for the rows. Defaults to the same height for all rows.
align
a vector of logicals the same length .... Defaults to TRUE for all subplots. If FALSE, no attempt is made to align the axes of the respective plot with the surroundding subplots.

Details

This function takes a list of ggplot-objects and arranges them in a grid, trying to align the axes. Horizontal alignment for plots with titles will not be perfect.