ggplot_grid: Grid of ggplot objects

Description Usage Arguments Value Author(s) Examples

View source: R/package_functions.R

Description

Modifies grid.arrange from the gridExtra package to take a list of objects of ggplot objects.

Usage

1

Arguments

g

A single ggplot object or a list of ggplot object defined as list(g1, g2, ...).

plot

Boolean (T, F) indicator of whether to plot or return a grob object

...

Other arguements passed to grid.arrange.

Value

A plot

Author(s)

Alex Hubbard (hubbard.alex@gmail.com)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(ggplot2)
g1 = ggplot(iris) +
  ggtitle("Title", subtitle = "Subtitle") +
  geom_point(aes(x = Sepal.Width, y = Sepal.Length, color = Species), size = 4) +
  od_theme()

g2 = ggplot(iris) +
  ggtitle("Title", subtitle = "Subtitle") +
  geom_point(aes(x = Sepal.Width, y = Sepal.Length, color = Species), size = 4) +
  od_theme(n = length(unique(iris$Species)))

ggplot_grid(list(g1, g2), nrow = 1, ncol = 2)

opendoor-labs/projectmap documentation built on Oct. 8, 2019, 1:58 p.m.