From 5ef3b6ca090b4c7d9eb0a3bbb5450142d39c9daf Mon Sep 17 00:00:00 2001 From: Bill Evans Date: Fri, 29 Oct 2021 12:06:20 -0400 Subject: [PATCH] Correct doc for print.ggplot, returns 'x' not 'data' (#4390) --- NEWS.md | 3 +++ R/plot.r | 4 +--- man/print.ggplot.Rd | 4 +--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/NEWS.md b/NEWS.md index 9364b75a31..939d829a49 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,8 @@ # ggplot2 (development version) +* Updated documentation for `print.ggplot` to reflect that it returns + the original plot, not the result of `ggplot_build()`. (@r2evans, #4390) + * `scale_*_manual()` no longer displays extra legend keys, or changes their order, when a named `values` argument has more items than the data. To display all `values` on the legend instead, use diff --git a/R/plot.r b/R/plot.r index d1b9a5f5a7..51f10a3187 100644 --- a/R/plot.r +++ b/R/plot.r @@ -137,9 +137,7 @@ is.ggplot <- function(x) inherits(x, "ggplot") #' @param vp viewport to draw plot in #' @param ... other arguments not used by this method #' @keywords hplot -#' @return Invisibly returns the result of [ggplot_build()], which -#' is a list with components that contain the plot itself, the data, -#' information about the scales, panels etc. +#' @return Invisibly returns the original plot. #' @export #' @method print ggplot #' @examples diff --git a/man/print.ggplot.Rd b/man/print.ggplot.Rd index 68d2df86a9..72a84220b9 100644 --- a/man/print.ggplot.Rd +++ b/man/print.ggplot.Rd @@ -19,9 +19,7 @@ \item{...}{other arguments not used by this method} } \value{ -Invisibly returns the result of \code{\link[=ggplot_build]{ggplot_build()}}, which -is a list with components that contain the plot itself, the data, -information about the scales, panels etc. +Invisibly returns the original plot. } \description{ Generally, you do not need to print or plot a ggplot2 plot explicitly: the