Replace a ggplot2's labels (title, subtitle, and/or caption) with a given string. Works for regular ggplot2 plots and patchwork plots.

replace_labs(p, labs = list(title = NULL, subtitle = NULL, caption = NULL))

Arguments

p

ggplot2 object

labs

named list of labels to replace; must contain elements named 'title', 'subtitle', and 'caption', and no other elements.