YDL<-readRDS("YDL.rds")a<-as.data.frame(table(YDL@meta.data$seurat_clusters))# 数据准备info = a$Freq# 命名names = c("0","1","2","3","4","5","6")# 涂色(可选)cols = c("#ED1C24","#22B14C","#FFC90E","#3f48CC","#3f90CC","#22B17C","#FFC93E")# 计算百分比piepercent = paste(round(100*info/sum(info)), "%")# 绘图pie(info, labels=piepercent, main = "cluster ratio", col=cols, family='GB1')# 添加颜色样本标注legend("topright", names, cex=0.8, fill=cols)
使用饼图_使用R做饼图展示单细胞的cluster的比例
最新推荐文章于 2024-05-31 16:52:21 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)