Closed Koncopd closed 2 years ago
Can you give some version info? I can't reproduce with:
In [1]: import scanpy as sc
In [2]: pbmc = sc.datasets.pbmc3k_processed().raw.to_adata()
In [3]: genes = list(pbmc.uns["rank_genes_groups"]["names"][0])
In [4]: sc.pl.stacked_violin(pbmc, var_names=genes, groupby='louvain', swap_axes=True)
Yes, i use matplotlib version 3.3.4.
for this version https://matplotlib.org/3.3.4/api/colorbar_api.html?highlight=colorbar#matplotlib.colorbar.Colorbar
mappable
is required.
For the last version it is not the case.
https://matplotlib.org/stable/api/colorbar_api.html
Here's the commit that caused the issue: https://github.com/theislab/scanpy/commit/4cb8a61df2628f00ce7d1fff5a3b25dcbe2222ff
So the difference was switching from ColorBarBase to ColorBar, but also it looks like ColorBarBase
only allows a single positional argument in the most recent Matplotlib
release.
Could do a conditional around matplotlib versions? Or could restrict which versions can be used?
The attached fix works on all versions.
Oh, I had assumed the test failures were related.
Any idea what's up with those?
No, i see the same test failures on the PR unrelated to plotting. No, i haven't looked yet.
sc.pl.stacked_violin(adata_pl, var_names=check_terms, groupby='ct_cond', swap_axes=True)
always get the error