From 947f5fbd0930da5843ccabd73f3d610c9dfe0237 Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Mon, 6 Jan 2025 09:51:36 +0100 Subject: [PATCH 1/3] mention ignored arguments --- R/guide-legend.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/guide-legend.R b/R/guide-legend.R index 37aad2e3f0..8ef412053a 100644 --- a/R/guide-legend.R +++ b/R/guide-legend.R @@ -15,7 +15,11 @@ #' specified in [labs()] is used for the title. #' @param theme A [`theme`][theme()] object to style the guide individually or #' differently from the plot's theme settings. The `theme` argument in the -#' guide overrides, and is combined with, the plot's theme. +#' guide partially overrides, and is combined with, the plot's theme. +#' Arguments that apply to a single legend are respected, most of which have +#' the `legend`-prefix. Arguments that apply to combined legends +#' (the legend box) are ignored, including `legend.position`, +#' `legend.justification.*`, `legend.location` and `legend.box.*`. #' @param position A character string indicating where the legend should be #' placed relative to the plot panels. #' @param direction A character string indicating the direction of the guide. From 69bbd887313b5ccea94b4ad52ef4113e7be2fc41 Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Mon, 6 Jan 2025 09:51:58 +0100 Subject: [PATCH 2/3] No need to fuss over these specifics with axes --- R/guide-axis.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/guide-axis.R b/R/guide-axis.R index 70ac3da43f..d445900071 100644 --- a/R/guide-axis.R +++ b/R/guide-axis.R @@ -6,6 +6,9 @@ #' [scale_(x|y)_discrete()][scale_x_discrete()]. #' #' @inheritParams guide_legend +#' @param theme A [`theme`][theme()] object to style the guide individually or +#' differently from the plot's theme settings. The `theme` argument in the +#' guide partially overrides, and is combined with, the plot's theme. #' @param check.overlap silently remove overlapping labels, #' (recursively) prioritizing the first, last, and middle labels. #' @param angle Compared to setting the angle in [theme()] / [element_text()], From d7671ad6764c5452492de78c1d7e2cdbc1931b46 Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Mon, 6 Jan 2025 09:52:11 +0100 Subject: [PATCH 3/3] document --- man/guide_axis.Rd | 2 +- man/guide_axis_logticks.Rd | 2 +- man/guide_axis_stack.Rd | 2 +- man/guide_axis_theta.Rd | 2 +- man/guide_bins.Rd | 6 +++++- man/guide_colourbar.Rd | 6 +++++- man/guide_coloursteps.Rd | 6 +++++- man/guide_custom.Rd | 6 +++++- man/guide_legend.Rd | 6 +++++- 9 files changed, 29 insertions(+), 9 deletions(-) diff --git a/man/guide_axis.Rd b/man/guide_axis.Rd index 4d4ba4f166..baf05cebe6 100644 --- a/man/guide_axis.Rd +++ b/man/guide_axis.Rd @@ -24,7 +24,7 @@ specified in \code{\link[=labs]{labs()}} is used for the title.} \item{theme}{A \code{\link[=theme]{theme}} object to style the guide individually or differently from the plot's theme settings. The \code{theme} argument in the -guide overrides, and is combined with, the plot's theme.} +guide partially overrides, and is combined with, the plot's theme.} \item{check.overlap}{silently remove overlapping labels, (recursively) prioritizing the first, last, and middle labels.} diff --git a/man/guide_axis_logticks.Rd b/man/guide_axis_logticks.Rd index b6f7d55737..7398f24890 100644 --- a/man/guide_axis_logticks.Rd +++ b/man/guide_axis_logticks.Rd @@ -51,7 +51,7 @@ and \code{FALSE} are shorthand for \code{"both"} and \code{"none"} respectively. \item{theme}{A \code{\link[=theme]{theme}} object to style the guide individually or differently from the plot's theme settings. The \code{theme} argument in the -guide overrides, and is combined with, the plot's theme.} +guide partially overrides, and is combined with, the plot's theme.} \item{prescale_base, negative_small, short_theme}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}} diff --git a/man/guide_axis_stack.Rd b/man/guide_axis_stack.Rd index 4a18fc3fdb..542f4eb44b 100644 --- a/man/guide_axis_stack.Rd +++ b/man/guide_axis_stack.Rd @@ -30,7 +30,7 @@ specified in \code{\link[=labs]{labs()}} is used for the title.} \item{theme}{A \code{\link[=theme]{theme}} object to style the guide individually or differently from the plot's theme settings. The \code{theme} argument in the -guide overrides, and is combined with, the plot's theme.} +guide partially overrides, and is combined with, the plot's theme.} \item{spacing}{A \code{\link[=unit]{unit()}} objects that determines how far separate guides are spaced apart.} diff --git a/man/guide_axis_theta.Rd b/man/guide_axis_theta.Rd index 6e18e57a60..79f4b61cad 100644 --- a/man/guide_axis_theta.Rd +++ b/man/guide_axis_theta.Rd @@ -22,7 +22,7 @@ specified in \code{\link[=labs]{labs()}} is used for the title.} \item{theme}{A \code{\link[=theme]{theme}} object to style the guide individually or differently from the plot's theme settings. The \code{theme} argument in the -guide overrides, and is combined with, the plot's theme.} +guide partially overrides, and is combined with, the plot's theme.} \item{angle}{Compared to setting the angle in \code{\link[=theme]{theme()}} / \code{\link[=element_text]{element_text()}}, this also uses some heuristics to automatically pick the \code{hjust} and \code{vjust} that diff --git a/man/guide_bins.Rd b/man/guide_bins.Rd index 8ee5311445..d9fd873cdb 100644 --- a/man/guide_bins.Rd +++ b/man/guide_bins.Rd @@ -25,7 +25,11 @@ specified in \code{\link[=labs]{labs()}} is used for the title.} \item{theme}{A \code{\link[=theme]{theme}} object to style the guide individually or differently from the plot's theme settings. The \code{theme} argument in the -guide overrides, and is combined with, the plot's theme.} +guide partially overrides, and is combined with, the plot's theme. +Arguments that apply to a single legend are respected, most of which have +the \code{legend}-prefix. Arguments that apply to combined legends +(the legend box) are ignored, including \code{legend.position}, +\verb{legend.justification.*}, \code{legend.location} and \verb{legend.box.*}.} \item{angle}{Overrules the theme settings to automatically apply appropriate \code{hjust} and \code{vjust} for angled legend text. Can be a single number diff --git a/man/guide_colourbar.Rd b/man/guide_colourbar.Rd index 9a441f39cc..95546aa21c 100644 --- a/man/guide_colourbar.Rd +++ b/man/guide_colourbar.Rd @@ -49,7 +49,11 @@ specified in \code{\link[=labs]{labs()}} is used for the title.} \item{theme}{A \code{\link[=theme]{theme}} object to style the guide individually or differently from the plot's theme settings. The \code{theme} argument in the -guide overrides, and is combined with, the plot's theme.} +guide partially overrides, and is combined with, the plot's theme. +Arguments that apply to a single legend are respected, most of which have +the \code{legend}-prefix. Arguments that apply to combined legends +(the legend box) are ignored, including \code{legend.position}, +\verb{legend.justification.*}, \code{legend.location} and \verb{legend.box.*}.} \item{nbin}{A numeric specifying the number of bins for drawing the colourbar. A smoother colourbar results from a larger value.} diff --git a/man/guide_coloursteps.Rd b/man/guide_coloursteps.Rd index 5bec4a8d73..dc5806929a 100644 --- a/man/guide_coloursteps.Rd +++ b/man/guide_coloursteps.Rd @@ -43,7 +43,11 @@ specified in \code{\link[=labs]{labs()}} is used for the title.} \item{theme}{A \code{\link[=theme]{theme}} object to style the guide individually or differently from the plot's theme settings. The \code{theme} argument in the -guide overrides, and is combined with, the plot's theme.} +guide partially overrides, and is combined with, the plot's theme. +Arguments that apply to a single legend are respected, most of which have +the \code{legend}-prefix. Arguments that apply to combined legends +(the legend box) are ignored, including \code{legend.position}, +\verb{legend.justification.*}, \code{legend.location} and \verb{legend.box.*}.} \item{alpha}{A numeric between 0 and 1 setting the colour transparency of the bar. Use \code{NA} to preserve the alpha encoded in the colour itself diff --git a/man/guide_custom.Rd b/man/guide_custom.Rd index 74c8a9f00a..f13559cae2 100644 --- a/man/guide_custom.Rd +++ b/man/guide_custom.Rd @@ -25,7 +25,11 @@ If \code{NULL} (default), no title is shown.} \item{theme}{A \code{\link[=theme]{theme}} object to style the guide individually or differently from the plot's theme settings. The \code{theme} argument in the -guide overrides, and is combined with, the plot's theme.} +guide partially overrides, and is combined with, the plot's theme. +Arguments that apply to a single legend are respected, most of which have +the \code{legend}-prefix. Arguments that apply to combined legends +(the legend box) are ignored, including \code{legend.position}, +\verb{legend.justification.*}, \code{legend.location} and \verb{legend.box.*}.} \item{position}{A character string indicating where the legend should be placed relative to the plot panels.} diff --git a/man/guide_legend.Rd b/man/guide_legend.Rd index 67465c9877..366005c99f 100644 --- a/man/guide_legend.Rd +++ b/man/guide_legend.Rd @@ -25,7 +25,11 @@ specified in \code{\link[=labs]{labs()}} is used for the title.} \item{theme}{A \code{\link[=theme]{theme}} object to style the guide individually or differently from the plot's theme settings. The \code{theme} argument in the -guide overrides, and is combined with, the plot's theme.} +guide partially overrides, and is combined with, the plot's theme. +Arguments that apply to a single legend are respected, most of which have +the \code{legend}-prefix. Arguments that apply to combined legends +(the legend box) are ignored, including \code{legend.position}, +\verb{legend.justification.*}, \code{legend.location} and \verb{legend.box.*}.} \item{position}{A character string indicating where the legend should be placed relative to the plot panels.}