| split_legend | R Documentation |
Extract legend as separate grob and combine with patchwork
split_legend(p, ncol_split = 2)
p |
ggplot object |
ncol_split |
Number of columns for legend splitting (used for reflow) |
patchwork object. Note: This returns a patchwork object, not a ggplot object.
You cannot add ggplot2 layers with + after calling split_legend().
Use patchwork operators like | and / for layout composition.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.