GetLegend: Function to extract legend from a ggplot

View source: R/GetLegend.R

GetLegendR Documentation

Function to extract legend from a ggplot

Description

Function to extract the legend from a ggplot for manipulation in a publication plot. The code was obtained from a forum referenced below.

Usage

GetLegend(myggplot)

Arguments

myggplot

ggplot plot object

Value

Legend object as a separate plot object.

Author(s)

Richard T Gray, Rgray@kirby.unsw.edu.au

References

http://www.sthda.com/english/wiki/ggplot2-easy-way-to-mix-multiple-graphs-on-the-same-page-r-software-and-data-visualization#change-legend-position


leftygray/LeftysRpkg documentation built on Feb. 11, 2024, 5:13 p.m.