Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plot violin throws error when trying to change density argument #3458

Open
3 tasks done
LinearParadox opened this issue Feb 5, 2025 · 0 comments
Open
3 tasks done
Assignees

Comments

@LinearParadox
Copy link

Please make sure these conditions are met

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of scanpy.
  • (optional) I have confirmed this bug exists on the main branch of scanpy.

What happened?

It seems that plot violin is passing the density argument to seaborne twice

Minimal code sample

sc.pl.violin(adata, groupby="condition", use_raw=False, stripplot=False, keys="pct.mt", density_norm="area")

Error output

File ~/miniconda3/envs/scanpy/lib/python3.10/site-packages/legacy_api_wrap/__init__.py:80, in legacy_api.<locals>.wrapper.<locals>.fn_compatible(*args_all, **kw)
     77 @wraps(fn)
     78 def fn_compatible(*args_all: P.args, **kw: P.kwargs) -> R:
     79     if len(args_all) <= n_positional:
---> 80         return fn(*args_all, **kw)
     82     args_pos: P.args
     83     args_pos, args_rest = args_all[:n_positional], args_all[n_positional:]

File ~/miniconda3/envs/scanpy/lib/python3.10/site-packages/scanpy/plotting/_anndata.py:907, in violin(adata, keys, groupby, log, use_raw, stripplot, jitter, size, layer, scale, order, multi_panel, xlabel, ylabel, rotation, show, save, ax, **kwds)
    905     axs = [ax]
    906 for ax, y, ylab in zip(axs, ys, ylabel):
--> 907     ax = sns.violinplot(
    908         x=x,
    909         y=y,
    910         data=obs_tidy,
    911         order=order,
    912         orient="vertical",
    913         density_norm=scale,
    914         ax=ax,
    915         **kwds,
    916     )
    917     if stripplot:
    918         ax = sns.stripplot(
    919             x=x,
    920             y=y,
   (...)
    926             ax=ax,
    927         )

TypeError: seaborn.categorical.violinplot() got multiple values for keyword argument 'density_norm'

Versions

1.10.1
@LinearParadox LinearParadox added the Triage 🩺 This issue needs to be triaged by a maintainer label Feb 5, 2025
@ilan-gold ilan-gold removed the Triage 🩺 This issue needs to be triaged by a maintainer label Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants