Skip to content

Commit

Permalink
Docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunuuuu committed Nov 7, 2024
1 parent eb7a283 commit be3158d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
14 changes: 12 additions & 2 deletions R/plot-theme.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,22 @@
#' defined in the `⁠element tree`⁠ argument. [`Splicing`][rlang::splice] a list
#' is also supported.
#' @examples
#' plot_theme()
#' set.seed(123)
#' small_mat <- matrix(rnorm(81), nrow = 9)
#' ggheatmap(small_mat) +
#' plot_theme(plot.background = element_rect(fill = "red"))
#'
#' # `plot_theme()` serves as the default theme and will always be
#' # overridden by any `theme()` settings applied directly to the plot
#' ggheatmap(small_mat) +
#' theme(plot.background = element_rect(fill = "blue")) +
#' plot_theme(plot.background = element_rect(fill = "red"))
#'
#' @importFrom ggplot2 theme
#' @importFrom rlang inject
#' @export
plot_theme <- rlang::new_function(
# We utilize editor completion by listing all theme arguments here.
# We utilize editor completion by listing all `theme()` arguments here.
# By placing `...` at the beginning, we can check if the first
# following argument is a `theme()` object rather than individual theme
# elements.
Expand Down
12 changes: 11 additions & 1 deletion man/plot_theme.Rd

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

0 comments on commit be3158d

Please sign in to comment.