Scanpy: sc.pl.stacked_violin weird scale

Created on 1 Jun 2019  路  2Comments  路  Source: theislab/scanpy

I have an anndata called violin_adata like this:
AnnData object with n_obs 脳 n_vars = 2995 脳 10
obs: 'louvain'
All values in this adata is between 0 and 1; however when I plot the violin plot, it gets the scales to negative or 2. What should I adjust?
ax = sc.pl.stacked_violin(violin_adata, genes, groupby='louvain',dendrogram=True,swap_axes=True)
image

Most helpful comment

Hey!
It looks like this might be due to the kde. You could pass cut=0 to ensure the kde doesn't go past 0. It will however look less nice then. But that is just a limitation of kernel density estimation I guess...

All 2 comments

Hey!
It looks like this might be due to the kde. You could pass cut=0 to ensure the kde doesn't go past 0. It will however look less nice then. But that is just a limitation of kernel density estimation I guess...

Curiously, in one of my latest PR (https://github.com/theislab/scanpy/pull/661) I set cut=0 as default to
address this issue. From what I see, this is the default also for Seurat.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Olivia117 picture Olivia117  路  4Comments

wflynny picture wflynny  路  6Comments

picciama picture picciama  路  4Comments

zhangguy picture zhangguy  路  5Comments

falexwolf picture falexwolf  路  4Comments