get_labs: Extract custom labels from ggplot object

View source: R/utils.R

get_labsR Documentation

Extract custom labels from ggplot object

Description

Extract custom labels from ggplot object

Usage

get_labs(g, ggbuild = NULL)

Arguments

g

ggplot object

ggbuild

already built ggplot_built object if available

Value

named vector of labels

Examples

a <- ggplot2::ggplot(ggplot2::mpg, ggplot2::aes(displ, hwy)) +
  ggplot2::geom_point(ggplot2::aes(color = as.factor(cyl))) +
  ggplot2::geom_text(ggplot2::aes(label = model))
get_labs(a)

colorrepel documentation built on July 14, 2026, 9:07 a.m.