Skip to content

Commit

Permalink
document
Browse files Browse the repository at this point in the history
  • Loading branch information
teunbrand committed Sep 5, 2024
1 parent 48e7dcf commit 1ca6a39
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ export(get_alt_text)
export(get_element_tree)
export(get_geom_defaults)
export(get_guide_data)
export(get_labs)
export(get_last_plot)
export(get_layer_data)
export(get_layer_grob)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ggplot2 (development version)

* New `get_labs()` function for retrieving completed plot labels
(@teunbrand, #6008).
* `guide_bins()`, `guide_colourbar()` and `guide_coloursteps()` gain an `angle`
argument to overrule theme settings, similar to `guide_axis(angle)`
(@teunbrand, #4594).
Expand Down
5 changes: 5 additions & 0 deletions R/labels.R
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ ggtitle <- function(label, subtitle = waiver()) {
labs(title = label, subtitle = subtitle)
}

#' @rdname labs
#' @export
#' @param plot A ggplot object
#' @description
#' `get_labs()` retrieves completed labels from a plot.
get_labs <- function(plot = get_last_plot()) {
plot <- ggplot_build(plot)

Expand Down
7 changes: 7 additions & 0 deletions man/labs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1ca6a39

Please sign in to comment.