ggAlignPlots | R Documentation |
This function aligns ggplots vertically or horizontally
ggAlignPlots(..., plotList = NULL, sizes = NULL, type = "v", draw = TRUE)
... |
All additional arguments will be interpreted as |
plotList |
A list of |
sizes |
A numeric vector or list of values indicating the relative size for each of the objects in |
type |
A string indicating wheter vertical ("v") or horizontal ("h") alignment should be used for the multi-plot layout. |
draw |
A boolean value indicating whether to draw the plot(s) ( |
# Create Random Data
m <- data.frame(x=matrix(rnorm(10, 2),ncol=1))
m$color <- sample(c("A", "B"), 10, replace = TRUE)
# Plot
p <- ggGroup(x = m$color, y = m$x)
# To PDF
pdf("test.pdf", width = 4, height = 7)
ggAlignPlots(p, p)
dev.off()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.