我正在使用ggplot创建一个boxplot.当我减小箱图的宽度时,x轴类别之间的空间增加.我希望能够缩小x轴类别之间的空间,并使箱形图更接近彼此.
p<-ggplot(data.plot1, aes(time2, Count))
p+geom_boxplot(outlier.shape = NA, width=0.3)+
ggtitle("")+ylab("Cell Count (cells/mL) ")+ xlab("Time") +
theme_bw()+ coord_cartesian(ylim = c(0, 850))+
geom_hline(data=normal1, aes(yintercept = val), linetype="dashed")+
facet_grid(.~CellType1)
Run Code Online (Sandbox Code Playgroud)
因此,基本上,减少第0天,第30天,第100天之间的空间,并使箱形图彼此更接近.