grid_arrange_shared_legend | R Documentation |
This function creates a common legend for the given pots to share This was taken from the following link: https://github.com/tidyverse/ggplot2/wiki/Share-a-legend-between-two-ggplot2-graphs
grid_arrange_shared_legend( ..., list = NULL, ncol = NULL, nrow = 1, position = c("bottom", "right"), legend = NULL, legend_plot = NULL )
... |
A series of plots to share a common legend |
list |
A list of plots to share a common legend. Defaults to NULL. If list is specified, ellipsis argument is ignored. |
ncol |
Number of columns of the arranged plots. Defaults to NULL, in which case it is the length of the list. |
nrow |
Number of rows of the arranged plots |
position |
Position of the legend |
legend |
If legend is supplied from outside. Defaults to NULL. |
legend_plot |
If plot to pull the legend from is supplied from outside. Defaults to NULL. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.