Skip to content

Commit 81f46c1

Browse files
committed
add test
1 parent a9aa06e commit 81f46c1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/testthat/test-mean-error-bars.R

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,21 @@ test_that("different colors for error bars, points, and lines", {
3636
geom_point(color = "blue", size = 14)
3737
L <- save_outputs(one.line.gg, "error-simple-line-point-crazy")
3838
})
39+
40+
# example from https://github.com/ropensci/plotly/issues/513
41+
42+
d <- data.frame(
43+
x = 1:5,
44+
y = 1:5,
45+
label = letters[1:5],
46+
group = factor(c('one', 'one', 'two', 'two', 'one'))
47+
)
48+
fig1 <- ggplot(d, aes(x = x, y = y, text = label, colour = group)) +
49+
geom_rect(fill = 'lightgrey', colour = 'lightgrey',
50+
xmin = 3, xmax = 4, ymin = -4, ymax = 7) +
51+
geom_point() + geom_errorbarh(aes(xmin = x - 1, xmax = x + 2), alpha = 0.5) +
52+
theme_bw()
53+
54+
test_that("error bars respect trace ordering", {
55+
L <- save_outputs(fig1, "error-rect-alpha")
56+
})

0 commit comments

Comments
 (0)