位置闪避不使用geom bar plot

时间:2016-09-14 22:10:51

标签: r ggplot2

我有这个条形图

group = c("A","A","B","B")
value = c(1,2,3,4)
day = c(1,2,1,2)
dat = data.frame(group = group , value = value, day = day)
dat

ggplot(data=dat, aes(x = group, y = value, fill = day)) +
    geom_bar(stat = "identity", position = "dodge")

它堆叠但我不想堆叠。相反,我想使用position = "dodge"让每个人彼此相邻的日子相互叠加。任何想法如何让每个小组彼此相邻?

0 个答案:

没有答案