facet_grid中的“躲避”错误栏

时间:2016-06-27 06:44:35

标签: r ggplot2

我正在尝试添加错误栏,但他们不会根据我的fill-parameter“躲闪”。我做错了吗?

 > head(dual)
  siRNA    value CellLine        std Time
1 X1    1.686577       KO 0.18671567   3h
2 X2    1.363829       KO 0.12593857   3h
3 X3    1.264940       KO 0.02890541   3h
4 X4    1.368086       KO 0.11471607   3h
5 X5    1.324891       KO 0.02526011   3h
6 X6    1.274572       KO 0.17476550   3h

p <- ggplot(dual, aes(siRNA, value)) + 
  geom_bar(aes(fill=CellLine), stat="identity",position = "dodge") + 
  theme_bw() + 
  theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
  facet_grid(~Time, scales="free") + theme_bw() 

p +  geom_errorbar(aes(ymin=value-std, ymax=value+std), width=.1) +
     facet_grid(~Time)

0 个答案:

没有答案