From 14e005583c3bf7e0f678501512beefe4e88c1a80 Mon Sep 17 00:00:00 2001 From: tanmaydimriGSOC Date: Fri, 19 Dec 2025 17:15:59 +0530 Subject: [PATCH] docs: clarify how vline, hline, and abline affect position scales --- DESCRIPTION | 2 +- R/geom-abline-hline-vline.R | 7 ++++++- man/geom_abline.Rd | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 35e8fff9fd..d062dd85a9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -84,7 +84,7 @@ Config/usethis/last-upkeep: 2025-04-23 Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.3 +RoxygenNote: 7.3.3.9000 Collate: 'aes-delayed-eval.R' 'aes-variants.R' diff --git a/R/geom-abline-hline-vline.R b/R/geom-abline-hline-vline.R index fec2af5dfd..6fd10556ab 100644 --- a/R/geom-abline-hline-vline.R +++ b/R/geom-abline-hline-vline.R @@ -17,7 +17,12 @@ NULL #' #' Unlike most other geoms, these geoms do not inherit aesthetics from the plot #' default, because they do not understand x and y aesthetics which are -#' commonly set in the plot. They also do not affect the x and y scales. +#' commonly set in the plot. +#' +#' Unlike [geom_abline()], [geom_vline()] and [geom_hline()] include their +#' intercepts in the position aesthetics. As a result, `xintercept` and +#' `yintercept` values can affect the x and y scales, particularly when +#' intercepts fall outside the range of the data. #' #' @section Aesthetics: #' These geoms are drawn using [geom_line()] so they support the diff --git a/man/geom_abline.Rd b/man/geom_abline.Rd index fa0550aeee..8e97993ef5 100644 --- a/man/geom_abline.Rd +++ b/man/geom_abline.Rd @@ -146,7 +146,12 @@ to vary across facets, construct the data frame yourself and use aesthetics. Unlike most other geoms, these geoms do not inherit aesthetics from the plot default, because they do not understand x and y aesthetics which are -commonly set in the plot. They also do not affect the x and y scales. +commonly set in the plot. + +Unlike \code{\link[=geom_abline]{geom_abline()}}, \code{\link[=geom_vline]{geom_vline()}} and \code{\link[=geom_hline]{geom_hline()}} include their +intercepts in the position aesthetics. As a result, \code{xintercept} and +\code{yintercept} values can affect the x and y scales, particularly when +intercepts fall outside the range of the data. } \section{Aesthetics}{