We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9dee894 commit 0f81022Copy full SHA for 0f81022
DESCRIPTION
@@ -49,4 +49,4 @@ Suggests:
49
RSclient,
50
broom
51
LazyData: true
52
-RoxygenNote: 5.0.0
+RoxygenNote: 5.0.1
tests/testthat/test-ggplot-legend.R
@@ -103,15 +103,9 @@ test_that("very long legend items", {
103
104
# test of legend position
105
test_that("many legend items", {
106
- many_items <- data.frame(cat1 = sample(x = paste0("Group ", LETTERS[1:12]),
107
- size = 100, replace = TRUE),
108
- cat2 = sample(x = c("foo", "bar", "baz"),
109
- size = 100, replace = TRUE))
110
- p_many_items <- ggplot(many_items, aes(cat2, fill=cat1)) +
111
- geom_bar(position="dodge")
112
- info <- expect_traces(p_many_items, 12, "many legend items")
+ p <- ggplot(midwest, aes(category, fill= category)) + geom_bar()
+ info <- expect_traces(p, nlevels(midwest$category), "many legend items")
113
expect_equal(length(info$layout$annotations), 1)
114
- expected.names <- levels(many_items$cat2)
115
expect_identical(info$layout$annotations[[1]]$y > 0.5, TRUE)
116
expect_identical(info$layout$annotations[[1]]$y -
117
info$layout$legend$y > 0, TRUE)
0 commit comments