I noticed that the docs for theme() are missing the new palette.* elements.
That got me thinking that it would be possible to add a test to catch this in future, based on something like this:
all_elems <- names(ggplot2:::ggplot_global$element_tree)
doc_fmls <- rlang::fn_fmls_names(ggplot2::theme)
setdiff(all_elems, doc_fmls)
#> [1] "strip.placement.x" "strip.placement.y"
#> [3] "palette.colour.discrete" "palette.colour.continuous"
#> [5] "palette.fill.discrete" "palette.fill.continuous"
#> [7] "palette.alpha.discrete" "palette.alpha.continuous"
#> [9] "palette.linewidth.discrete" "palette.linewidth.continuous"
#> [11] "palette.size.discrete" "palette.size.continuous"
#> [13] "palette.shape.discrete" "palette.shape.continuous"
#> [15] "palette.linetype.discrete" "palette.linetype.continuous"
Created on 2026-03-31 with reprex v2.1.1
As discussed below, this issues is just about any missing parameters that were unintentionally left off.
I noticed that the docs for
theme()are missing the newpalette.*elements.That got me thinking that it would be possible to add a test to catch this in future, based on something like this:
Created on 2026-03-31 with reprex v2.1.1
As discussed below, this issues is just about any missing parameters that were unintentionally left off.