Description Usage Arguments Value Author(s) Examples
Arrange grobs and parse their legend, then put it together on the right.
1 2 |
... |
ggplot graphics. |
nrow |
number of row for layout. |
ncol |
number of columns for layout |
widths |
width ratio for plot group and legend group. |
legend.idx |
legend index you want to keep. |
a
Tengfei Yin
1 2 3 4 5 6 7 8 | library(ggplot2)
p1 <- qplot(x = mpg, y= cyl, data = mtcars, color = carb)
p2 <- qplot(x = mpg, y= cyl, data = mtcars, color = wt)
p3 <- qplot(x = mpg, y= cyl, data = mtcars, color = qsec)
p4 <- qplot(x = mpg, y= cyl, data = mtcars, color = gear)
arrangeGrobByParsingLegend(p1, p2, p3, p4)
arrangeGrobByParsingLegend(p1, p2, p3, p4, ncol = 1)
arrangeGrobByParsingLegend(p1, p2, p3, p4, legend.idx = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.