Skip to contents

This function generates alternative text for ggplot objects.

Usage

generate_alt_text(g)

Arguments

g

A ggplot object.

Value

A character string containing alternative text describing the input ggplot object.

Examples

library(ggplot2)
g1 <- ggplot(data = mtcars,
             mapping = aes(x = mpg,
                           y = disp)) +
  geom_point()
generate_alt_text(g1)
#> [1] "A plot with mpg on the x-axis and disp on the y-axis. The data is displayed using points."