arrangeGrob: arrangeGrob

Description Usage Arguments Value Examples

Description

arrange ggplot2, lattice, and grobs on a page

Usage

1
2
  arrangeGrob(..., as.table = FALSE, clip = TRUE,
    main = NULL, sub = NULL, left = NULL, legend = NULL)

Arguments

...

plots of class ggplot2, trellis, or grobs, and valid arguments to grid.layout

main

string, or grob (requires a well-defined height, see example)

sub

string, or grob (requires a well-defined height, see example)

legend

string, or grob (requires a well-defined width, see example)

left

string, or grob (requires a well-defined width, see example)

as.table

logical: bottom-left to top-right or top-left to bottom-right

clip

logical: clip every object to its viewport

Value

return a frame grob; side-effect (plotting) if plot=T

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
require(ggplot2)
plots = lapply(1:5, function(.x) qplot(1:10,rnorm(10), main=paste("plot",.x)))
require(gridExtra)
do.call(grid.arrange,  plots)
require(lattice)
grid.arrange(qplot(1:10), xyplot(1:10~1:10),
tableGrob(head(iris)), nrow=2, as.table=TRUE, main="test main",
sub=textGrob("test sub", gp=gpar(font=2)))

## End(Not run)

ttriche/oldGridExtra documentation built on June 1, 2019, 2:51 a.m.