theislab / scvelo

RNA Velocity generalized through dynamical modeling
https://scvelo.org
BSD 3-Clause "New" or "Revised" License
414 stars 102 forks source link

Better handling of legends #426

Open VolkerBergen opened 3 years ago

VolkerBergen commented 3 years ago
adata = scv.datasets.dentategyrus()
scv.pp.filter_and_normalize(adata)
scv.pp.moments(adata)

scv.tl.louvain(adata, resolution=2)
adata.obs['louvain'].cat.categories = [k + ' some celltype name' for k in adata.obs['louvain'].cat.categories]

scv.pl.scatter(adata, c=['louvain', 'age(days)'], legend_loc='right')
scv.pl.scatter(adata, c=['louvain', 'age(days)'], legend_loc='on data')

produces these rather unaesthetic figures.

image image

For the first one, we should figure out how to avoid such overlapping. For the second, we could make use of https://github.com/Phlya/adjustText.

WeilerP commented 3 years ago

@VolkerBergen, has this been fixed here?

VolkerBergen commented 3 years ago

1) open -> needs an adjustment of wspace/hspace depending on the legend. 2) is fixed.