I\'m using facet_grid() to display some data, and I have facet labels that span multiple lines of text (they contain the "\\n" character).
require(g
Until someone comes along with a real solution, here's a hack: Add space in the labels to get the justification you want.
require(ggplot2)
#Generate example data
set.seed(3)
df = data.frame(facet_label_text = rep(c("Label A",
"Label B \nvery long label",
"Label C\nshort ",
"Label D"),
each = 5),
time = rep(c(0, 4, 8, 12, 16), times = 4),
value = runif(20, min=0, max=100))
#Plot test data
ggplot(df, aes(x = time, y = value)) +
geom_line() +
facet_grid(facet_label_text ~ .) +
theme(strip.text.y = element_text(angle = 0, hjust = 0))