6
我该如何避免附加箱形图?谢谢ggplot增加箱形图之间的距离
ggplot(df, aes(x=factor(time), y=val, fill=ID))+
geom_boxplot()+
scale_fill_manual(values=c(WT="goldenrod3", KO="steelblue"))
我该如何避免附加箱形图?谢谢ggplot增加箱形图之间的距离
ggplot(df, aes(x=factor(time), y=val, fill=ID))+
geom_boxplot()+
scale_fill_manual(values=c(WT="goldenrod3", KO="steelblue"))
看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))