combine_plots: Combine multiple ggplots into one plot

Description Usage Arguments Value Examples

View source: R/plotting.R

Description

Combine multiple ggplots into one plot

Usage

1
combine_plots(..., plots, layout, heights, widths, ncols, show = TRUE)

Arguments

...

names of plot objects

plots

a list of plot objects if not using ...

layout

custom plot layout

heights

ratio of heights per row

widths

ratio of widths per column

ncols

optionally specify number of columns instead of layout

show

Print plot or just return gtable object

Value

gtable

Examples

1
2
3
4
5
6
my_plots <- lapply(1:5, function(i) ggplot2::qplot(rnorm(100), main=i))
combine_plots(plots = my_plots)
combine_plots(plots = my_plots,
layout = matrix(c(1:5,5), ncol=2, byrow = TRUE),
heights = c(.4,.4,.2),
widths = c(.6,.4))

iamamutt/mejr documentation built on May 18, 2019, 1:27 a.m.