I am trying to change the text direction in a facet nested chart with three variables on the one panel, I have tried (with only 2 variables) strip.text.y.right and strip.text.y.left, no dice! Ideally I would like the facet panel text to be as follows: left 90 degrees, the mid and right 0 degrees.
df <- data.frame(x = rep(1:10, each = 3),
y = rnorm(30),population = factor(rep(c(1,2,3,4,5,6),each = 5)),
group = factor(rep(c("New South Wales", "Queensland", "Victoria"), 10)),
category1 = factor(rep(c("LRPB Lancer", "LRPB Raider", "LRPB Flanker" ), each = 10))
)
p <- ggplot(df, aes(x, y)) +
geom_bar(stat = "identity") +
facet_nested(group+ category1 + population ~ ., scales = "free", space = "free", switch = "y") +
theme(
strip.placement = "outside",
strip.text.y.left = element_text(angle = 90), # Rotation for group
strip.text.y.right = element_text(angle = 0), # Rotation for category1
)
p