我想将刻面标签 (3, 4, 5) 移到 x 值 (4, 6, 8) 的下方。
我目前的代码:
library(ggplot2)
ggplot(mtcars) + aes(factor(cyl), wt) +
geom_bar(stat = "summary", fun.y = "mean") +
facet_grid(~gear, switch = "x")
目前,它看起来像这样:
我正在寻找看起来像这样的东西:
最佳答案
library(ggplot2)
ggplot(mtcars) + aes(factor(cyl), wt) +
geom_bar(stat = "summary", fun.y = "mean") +
facet_grid(~gear, switch = "x") +
theme(strip.placement = "outside")
关于r - 如何将 x 标签移动到 R 中 ggplot 中的分面标签上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47678182/