Skip to content

Commit c490ffc

Browse files
committed
Add test
1 parent d1fc26e commit c490ffc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/testthat/test-stat-ecdf.R

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,15 @@ test_that("stat_ecdf works in both directions", {
1515
expect_snapshot_error(ggplot_build(p))
1616
})
1717

18+
# See #5113 and #5112
19+
test_that("stat_ecdf responds to axis transformations", {
20+
n <- 4
21+
answer <- c(seq(0, 1, length.out = n + 1), 1)
22+
p <- ggplot(data_frame0(x = seq_len(n)), aes(x)) + stat_ecdf()
23+
24+
ld <- layer_data(p)
25+
expect_equal(ld$y, answer)
26+
27+
ld <- layer_data(p + scale_y_sqrt())
28+
expect_equal(ld$y, sqrt(answer))
29+
})

0 commit comments

Comments
 (0)