scanpy
scanpy copied to clipboard
Issue about plot stackedviolin.
- [√ ] Additional function parameters / changed functionality / changed defaults?
- [ ] New analysis tool: A simple analysis tool you have been using and are missing in
sc.tools
? - [ ] New plotting function: A kind of plot you would like to seein
sc.pl
? - [ ] External tools: Do you know an existing package that should go into
sc.external.*
? - [ √] Other?
Hi, when I used stacked violin to plot gene expression among groups on UMI levels, I was confused about the color bar about it. In detail you can see the following picture I got.
Like legend description 'Median expression in group', I guess the color palette is related about umi count value after scaling them among different groups (X-axis)? I'm not sure about the meaning of the color map.
Similar to Seurat displaying way like
How can I get similar plot by sc.pl.stacked_violin, and plot umi distribution only, without color map?
Any direction would be appreciated, thanks :)
Is it useful to change parameter including 'standard_scale' or norm?
Hi @UboCA,
You can use the row_palette
argument for this, as in this example:
import scanpy as sc
adata = sc.datasets.pbmc3k_processed()
sc.pl.stacked_violin(
adata,
var_names=["PTPRC", "RER1"],
groupby="louvain",
row_palette="tab10",
# swap_axes=True,
)
Which gives:
If you want to color by gene instead of by group, you can use the swap_axes argument.
Got it, many thanks!
Hi @UboCA,
You can use the
row_palette
argument for this, as in this example:import scanpy as sc adata = sc.datasets.pbmc3k_processed() sc.pl.stacked_violin( adata, var_names=["PTPRC", "RER1"], groupby="louvain", row_palette="tab10", # swap_axes=True, )
Which gives:
If you want to color by gene instead of by group, you can use the swap_axes argument.
Hi,
I solved the issue of inputting specific colors with the row_palette argument, but when using swap_axes to have the same plot as in Seurat (bottom image), it colors genes instead clusters as you mention. Is there any way to input the palette list by columns instead of by rows?