一行代码即可简单优雅地搞定细胞比例堆叠条形图:
pd.crosstab(adata.obs['sample'], adata.obs['celltype'], normalize='index').plot(kind='bar', xlabel='', stacked=True).legend()
一行代码即可简单优雅地搞定细胞比例堆叠条形图:
pd.crosstab(adata.obs['sample'], adata.obs['celltype'], normalize='index').plot(kind='bar', xlabel='', stacked=True).legend()