如何在R中的ggplot中将x标签移动到小平面标签上

Ami*_*son 5 r graph facet bar-chart ggplot2

我想将构面标签(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")
Run Code Online (Sandbox Code Playgroud)

目前,它看起来像这样:

目前

我正在寻找看起来像这样的东西:

目标

Mar*_*dri 5

library(ggplot2)
ggplot(mtcars) + aes(factor(cyl), wt) + 
geom_bar(stat = "summary", fun.y = "mean") + 
facet_grid(~gear, switch = "x") +
theme(strip.placement = "outside")
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明