-
Notifications
You must be signed in to change notification settings - Fork 614
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
requesting ncols parameter in sc.pl.violin() #1552
Labels
Comments
Any news on this ?? |
Also looking forward to this update |
Looking forward to this update or is there any other way to achieve this? |
It seems that the question has not be addressed yet, and still can't find the ncols parameter alike. |
Pull requests welcome! You can achieve this e.g. like this: import itertools
import math
import matplotlib.figure
import scanpy as sc
# parameters
ad = sc.datasets.pbmc68k_reduced()
vars = ["n_genes", "percent_mito", "n_counts", "S_score", "G2M_score"]
n_cols = 3
# plotting code
n_rows = math.ceil(len(vars) / n_cols)
fig = matplotlib.figure.Figure()
axs = fig.subplots(n_rows, 1)
for ax, v in zip(axs.flat, itertools.batched(vars, n_cols)):
sc.pl.violin(ad, v, ax=ax)
fig |
Hi! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
It would be nice to have a way to split the violin plots from
sc.pl.violin()
into a specific number of rows, similar to thencols
parameter inscanpy.pl.umap()
The text was updated successfully, but these errors were encountered: