如何将x标签移动到R中ggplot中的facet标签上
how to move x labels to be over facet labels in ggplot in R
我想将小平面标签 (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")
我想将小平面标签 (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")