Skip to content

Commit 27f04b2

Browse files
committed
Fix #1808
@thomasp85: I don't know why there was a do.call here, and I don't know why removing it fixed the bug. Probably something to do with lazyeval.
1 parent feb3ffd commit 27f04b2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

R/layout.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,16 @@ Layout <- ggproto("Layout", NULL,
164164
label_grobs <- lapply(names(labels), function(label) {
165165
lapply(c(1, 2), function(i) {
166166
modify <- if (i == 2 && label == "y") ".right" else if (i == 1 && label == "x") ".top" else ""
167-
if (is.null(labels[[label]][[i]]) || is.waive(labels[[label]][[i]])) return(zeroGrob())
168-
args <- list(
167+
if (is.null(labels[[label]][[i]]) || is.waive(labels[[label]][[i]]))
168+
return(zeroGrob())
169+
170+
element_render(
169171
theme = theme,
170172
element = paste0("axis.title.", label, modify),
171173
label = labels[[label]][[i]],
172174
expand_x = label == "y",
173175
expand_y = label == "x"
174176
)
175-
do.call(element_render, args)
176177
})
177178
})
178179
names(label_grobs) <- names(labels)

0 commit comments

Comments
 (0)