ggplotGrid {miscset} | R Documentation |
Arrange a List of ggplots
Description
Arrange a list of ggplots with grid.arrange and
output on local graphic device or as pdf/png when a path is supplied.
ggplotGridA4
writes the plots to a DIN A4 (8 x 11 inches) pdf file
directly.
Usage
ggplotGrid(l, path, ncol = 1, nrow = 1, width = 8, height = 11,
res = 300, pdf.cairo = TRUE, onefile = TRUE, ...)
ggplotGridA4(l, path, ncol = 2, nrow = 1, wide = TRUE)
ggplotlist(x, ncol = 1, path, width = 11, height = 8)
Arguments
l |
List with ggplot objects. |
path |
Plot to file of type pdf or png. Determine type by
path ending (.pdf or .png). |
ncol |
Number of columns. |
nrow |
Number of rows per page, only for pdfs. |
width |
For pdfs/pngs the width in inches, else ignored. |
height |
For pdfs/pngs the height in inches, else ignored. |
res |
Resolution in dpi for pngs. |
pdf.cairo |
|
onefile |
Create one file, see cairo_pdf. |
... |
Forwarded to cairo_pdf |
wide |
Wide format pdf pages (11x8 inches). |
x |
A list containing at least one ggplot object of class |
Author(s)
Sven E. Templer
Examples
#
## Not run:
library(ggplot2)
d <- data.frame(a=1:5,b=1:5)
x <- list(
ggplot(d, aes(x=a,y=b,col=b)) + geom_line(),
ggplot(d, aes(x=a,y=b,shape=factor(b))) + geom_point())
ggplotlist(x, 2)
## End(Not run)
#