ggguides
Simplified legend and guide alignment for ggplot2. One-liner functions for common legend operations.
I kept forgetting the commands to put a ggplot2 legend on the left, right, top or bottom, and looking them up again and again annoyed me. So I wrote ggguides, where legend_left() puts the legend on the left.
The package covers five kinds of legend work: positioning with functions like legend_left(), legend_right(), legend_top(), and legend_bottom(); direction control via legend_horizontal() and legend_vertical(); styling options for font size, family, wrapping, reversing, and reordering; tools for multiple legends including hiding, selecting, and managing guides; and multi-panel integration supporting patchwork and cowplot workflows.
Available on CRAN under MIT license.
install.packages("ggguides")
Citation
Colling G (2025). ggguides: Simplified Legend and Guide Alignment for ggplot2. doi:10.32614/CRAN.package.ggguides