Skip to content

Commit d1fc26e

Browse files
committed
Rename stat_ecdf()'s computed variable to ecdf
1 parent 0d0de37 commit d1fc26e

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# ggplot2 (development version)
22

3+
* Renamed computed aesthetic in `stat_ecdf()` to `ecdf`, to prevent incorrect
4+
scale transformations (@teunbrand, #5113 and #5112).
35
* Fixed a regression in `geom_hex()` where aesthetics were replicated across
46
bins (@thomasp85, #5037 and #5044)
57
* Fixed spurious warning when `weight` aesthetic was used in `stat_smooth()`

R/stat-ecdf.r

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#' and (Inf, 1)
2323
#' @section Computed variables:
2424
#' \describe{
25-
#' \item{y}{cumulative density corresponding x}
25+
#' \item{ecdf}{cumulative density corresponding x}
2626
#' }
2727
#' @export
2828
#' @examples
@@ -74,7 +74,7 @@ stat_ecdf <- function(mapping = NULL, data = NULL,
7474
StatEcdf <- ggproto("StatEcdf", Stat,
7575
required_aes = c("x|y"),
7676

77-
default_aes = aes(y = after_stat(y)),
77+
default_aes = aes(x = after_stat(ecdf), y = after_stat(ecdf)),
7878

7979
setup_params = function(self, data, params) {
8080
params$flipped_aes <- has_flipped_aes(data, params, main_is_orthogonal = FALSE, main_is_continuous = TRUE)
@@ -104,7 +104,7 @@ StatEcdf <- ggproto("StatEcdf", Stat,
104104

105105
df_ecdf <- data_frame0(
106106
x = x,
107-
y = data_ecdf,
107+
ecdf = data_ecdf,
108108
.size = length(x)
109109
)
110110
df_ecdf$flipped_aes <- flipped_aes

man/stat_ecdf.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)