From 9f818dd7aecbcb8f52d3eb4980120851a5422981 Mon Sep 17 00:00:00 2001 From: Achim Zeileis Date: Sat, 18 Oct 2025 03:17:30 +0200 Subject: [PATCH 1/2] documentation improvement for draw argument of tinyplot() --- R/tinyplot.R | 3 ++- man/tinyplot.Rd | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/R/tinyplot.R b/R/tinyplot.R index 597b8f05..6050985b 100644 --- a/R/tinyplot.R +++ b/R/tinyplot.R @@ -303,7 +303,8 @@ #' \code{\link[graphics]{abline}} or \code{\link[graphics]{text}}. Note that #' this argument is somewhat experimental and that _no_ internal checking is #' done for correctness; the provided argument is simply captured and -#' evaluated as-is. See Examples. +#' evaluated as-is within `tinyplot()` and thus has access to the local +#' definition of all variables such as `x`, `y`, etc. See Examples. #' @param restore.par a logical value indicating whether the #' \code{\link[graphics]{par}} settings prior to calling `tinyplot` should be #' restored on exit. Defaults to FALSE, which makes it possible to add diff --git a/man/tinyplot.Rd b/man/tinyplot.Rd index 676ed5e3..503f1579 100644 --- a/man/tinyplot.Rd +++ b/man/tinyplot.Rd @@ -452,7 +452,8 @@ elements to each facet of a faceted plot, e.g. \code{\link[graphics]{abline}} or \code{\link[graphics]{text}}. Note that this argument is somewhat experimental and that \emph{no} internal checking is done for correctness; the provided argument is simply captured and -evaluated as-is. See Examples.} +evaluated as-is within \code{tinyplot()} and thus has access to the local +definition of all variables such as \code{x}, \code{y}, etc. See Examples.} \item{empty}{logical indicating whether the interior plot region should be left empty. The default is \code{FALSE}. Setting to \code{TRUE} has a similar effect From c4c8bf18f4b50569de0960c4366948226f888ac8 Mon Sep 17 00:00:00 2001 From: Achim Zeileis Date: Sat, 18 Oct 2025 03:21:53 +0200 Subject: [PATCH 2/2] add remark in NEWS/Documentation about better draw manual --- NEWS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index d1863e24..bd907b8d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -26,6 +26,10 @@ where the formatting is also better._ - Add a "recession bars" section to the `Tips & tricks` vignette. (#503 @grantmcdermott) +- Point out more explicitly how the `draw` argument is evaluated within + `tinyplot()` and that it thus has access to the local definition to all + variables such as `x` and `y` etc. (#507 @zeileis) + ## 0.5.0 ### New features