Closed
Description
(previously: #4032 (comment))
Facet labels that are combined with .multi_line = FALSE
don't show up as parsed when using label_parsed
:
library("ggplot2")
dat <- data.frame(x = 1, y = 1, a = "a", b = 1)
ggplot(dat, aes(x, y)) +
geom_point() +
facet_grid(
~ a + b,
labeller = labeller(
a = c("a" = "a^2"),
.default = label_parsed,
.multi_line = FALSE
)
)
Created on 2020-06-22 by the reprex package (v0.3.0)
Compare to .multi_line = TRUE
, which looks as it should:
ggplot(dat, aes(x, y)) +
geom_point() +
facet_grid(
~ a + b,
labeller = labeller(
a = c("a" = "a^2"),
.default = label_parsed,
.multi_line = TRUE
)
)
One issue is the .multi_line
argument doesn't get passed along here:
Line 440 in 7d05fa3
However changing that line alone makes things worse:
ggplot(dat, aes(x, y)) +
geom_point() +
facet_grid(
~ a + b,
labeller = labeller(
a = c("a" = "a^2"),
.default = label_parsed,
.multi_line = FALSE
)
)