Description Usage Arguments Examples
View source: R/grid_arrange_shared_legend.R View source: R/create_linefigures_panel.R
This functions plots multiple plots in a panel, keeping only the fist legend of the fist plot keeping only the legend of the first plot
This functions plots multiple plots in a panel, keeping only the fist legend of the fist plot keeping only the legend of the first plot
1 2 3 4 5 |
... |
additional parameters to ggplot |
ncol |
Number of columns in the panel, defaults to the number of plots in the plotlist |
nrow |
Number of row, defaults to 1 |
position |
Legend position, defaults to c("bottom" , "right") |
ncol |
Number of columns in the panel, defaults to the number of plots in the plotlist |
... |
additional parameters to ggplot |
nrow |
Number of row, defaults to 1 |
position |
Legend position, defaults to c("bottom" , "right") |
1 2 3 4 5 6 7 8 9 10 11 12 13 | dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
p1 <- qplot(carat, price, data = dsamp, colour = clarity)
p4 <- qplot(depth, price, data = dsamp, colour = clarity)
grid_arrange_shared_legend(p1, p2, p3, p4, ncol = 4, nrow = 1)
scale_linetype_manual(values=c("solid",
"dotted", "longdash", "dotdash", "dashed"))
dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
p1 <- qplot(carat, price, data = dsamp, colour = clarity)
p4 <- qplot(depth, price, data = dsamp, colour = clarity)
grid_arrange_shared_legend(p1, p2, p3, p4, ncol = 4, nrow = 1)
scale_linetype_manual(values=c("solid",
"dotted", "longdash", "dotdash", "dashed"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.