如何避免附加盒子图?谢谢
ggplot(df, aes(x=factor(time), y=val, fill=ID))+
geom_boxplot()+
scale_fill_manual(values=c(WT="goldenrod3", KO="steelblue"))
答案 0 :(得分:4)
查看position_dodge
,width
参数可以帮助间距
mtcars$sep <- 1:2 # a factor
ggplot(mtcars, aes(x=factor(carb), y=mpg, fill=factor(sep))) +
geom_boxplot(position=position_dodge(width=0.8))