所以我正在使用 ggplot2 用我的数据制作一个漂亮的小图:
df1 <- data.frame(Background = factor(c("Input", "H3", "Overlap","Input", "H3", "Overlap"), levels=c("Input", "H3", "Overlap")),
Condition = factor(c("control", "control", "control","treatment", "treatment", "treatment")),
Count = c(10, 9, 5, 8, 7, 6))
barplot = ggplot(data=df1, aes(x=Condition, y=Count, fill=Background)) +
geom_bar(position=position_dodge()) +
facet_grid(. ~ Condition)
我想将“控制”与“治疗”分开。我有点实现了这一点,但两者仍然存在于各个面板中:
如何避免这种情况?
干杯。