如何在小平面网格线之间放置分区 [英] How to place divisions between facet grid lines
问题描述
我使用ggplot和 facet_grid
来制作发布图。我不确定审稿人如何对标准的灰色背景做出反应,使用白色网格线,所以我正在准备和不准备。但是,当我使用 opts(panel.background = theme_blank())
时,显示器缺少标准背景给出的窗格区分。
代码
ggplot(CO2,aes(conc))+ geom_density()+
facet_grid(Type〜Treatment)+
opts(panel.background = theme_blank())
当前结果
预期结果
last_plot()+ theme_bw()
$ c
$ b $ $ $ $ $ $ $ last_plot()+ $
opts(panel.background = theme_rect(fill = NA,color =black))
从版本0.9.2开始, opts
已被被主题
取代:
last_plot()+
主题(panel.background = element_rect(fill = NA,color =black))
I'm using ggplot with facet_grid
to make a plot for publication. I'm not sure how the reviewers will react to the standard gray background with white grid lines and so I'm preparing with and without. However when I use opts(panel.background = theme_blank())
the display lacks the between panes discrimination that the standard background gives. what is the easiest way to add the between pane grid back (not that it was there but it was white against gray) that looks similar to my desired outcome below?
The Code
ggplot(CO2, aes(conc)) + geom_density() +
facet_grid(Type~Treatment) +
opts(panel.background = theme_blank())
Current Outcome
Desired Outcome
Thank you in advance.
This should do:
last_plot() + theme_bw()
or
last_plot() +
opts(panel.background = theme_rect(fill = NA, color = "black"))
Since version 0.9.2, opts
has been replaced by theme
:
last_plot() +
theme(panel.background = element_rect(fill = NA, color = "black"))
这篇关于如何在小平面网格线之间放置分区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!