extract_plot_legend: Extract a legend from a ggplot object Extract a legend from a...

Description Usage Arguments Value

View source: R/extract_plot_legend.R

Description

Extract a legend from a ggplot object Extract a legend from a ggplot object and save it if Save argument set to TRUE

Usage

1
2
3
4
5
6
7
8
extract_plot_legend(
  gplot,
  width = 5,
  height = 5,
  device = "pdf",
  Save = FALSE,
  path_figure = NULL
)

Arguments

gplot

a ggplot2 object

width

a numeric value

height

a numeric value

device

a charchacter taking the form of pdf or png

Save

a boolean

path_figure

a directory or relative directory as charchacter

Value

the legend of a ggplot2 object


JBLecomte/JBUtilities documentation built on March 31, 2021, 7:25 p.m.