美文网首页
ggplot2: 控制轴上各个bar之间的聚集程度

ggplot2: 控制轴上各个bar之间的聚集程度

作者: LET149 | 来源:发表于2023-07-05 10:11 被阅读0次

https://www.zhihu.com/question/430557474
plot() + scale_x_discrete(expand = c(0,1))
plot() + scale_y_discrete(expand = c(0,1))

1. 示例

ggplot()+geom_violin(data=kk_1,  aes(x=seurat_clusters, y=nCount_RNA, fill=seurat_clusters))+scale_y_log10()+theme_cowplot()+NoLegend()+
  scale_x_discrete(limits=as.factor(c(1,2,7,5,8,3,4,9,0,6,10)), expand = c(0,1))  '#示例一

ggplot()+geom_violin(data=kk_1,  aes(x=seurat_clusters, y=nCount_RNA, fill=seurat_clusters))+scale_y_log10()+theme_cowplot()+NoLegend()+
  scale_x_discrete(limits=as.factor(c(1,2,7,5,8,3,4,9,0,6,10)), expand = c(0.9,1))  #示例二
示例一
示例二

相关文章

网友评论

      本文标题:ggplot2: 控制轴上各个bar之间的聚集程度

      本文链接:https://www.haomeiwen.com/subject/bvmyaltx.html