小编use*_*803的帖子

ggplot facetted geom_boxplot:减少x轴类别之间的空间

我正在使用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天之间的空间,并使箱形图彼此更接近.

r ggplot2 boxplot

5
推荐指数
1
解决办法
4081
查看次数

标签 统计

boxplot ×1

ggplot2 ×1

r ×1