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 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