【发布时间】:2017-08-25 21:17:54
【问题描述】:
当我们在 ggplot 中使用 facet 选项时,我们会在标题 (3,4,5) 周围看到一个漂亮的灰色框。
library(ggplot2)
data(mtcars)
ggplot(mtcars, aes(cyl)) + geom_bar() + facet_wrap(~gear) + theme_bw()
当我们不使用facet 选项时,如何在图表标题周围放置一个类似的灰色框?
ggplot(mtcars, aes(cyl)) + geom_bar() + theme_bw() +
ggtitle("How do you put a grey box around me??")
【问题讨论】: