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

Making var_group_rotation work when swap_axes is True #1763

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gokceneraslan
Copy link
Collaborator

@gokceneraslan gokceneraslan commented Mar 25, 2021

It'd be great if var_group_rotation option works also when swap_axes is True (right now rotation 270 is hard-coded). I tried to modify the code but I am not sure how to solve it properly (e.g. if labels are too long etc). Please have a look whenever you guys have time and feel free to modify the PR.

import scanpy as sc

ad = sc.datasets.paul15()
sc.pp.log1p(ad)
sc.tl.rank_genes_groups(ad, 'paul15_clusters')

sc.pl.rank_genes_groups_dotplot(ad, n_genes=3, dendrogram=False, var_group_rotation=0, groups=['1Ery', '2Ery', '3Ery'])
sc.pl.rank_genes_groups_dotplot(ad, n_genes=3, dendrogram=False, var_group_rotation=90, groups=['1Ery', '2Ery', '3Ery'])
sc.pl.rank_genes_groups_dotplot(ad, n_genes=3, dendrogram=False, swap_axes=True, var_group_rotation=0, groups=['1Ery', '2Ery', '3Ery'])
sc.pl.rank_genes_groups_dotplot(ad, n_genes=3, dendrogram=False, swap_axes=True, var_group_rotation=90, groups=['1Ery', '2Ery', '3Ery'])

Output:

image

image

@codecov
Copy link

codecov bot commented Mar 25, 2021

Codecov Report

Merging #1763 (d882574) into master (560bd5d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1763   +/-   ##
=======================================
  Coverage   71.18%   71.19%           
=======================================
  Files          92       92           
  Lines       11190    11189    -1     
=======================================
  Hits         7966     7966           
+ Misses       3224     3223    -1     
Impacted Files Coverage Δ
scanpy/plotting/_baseplot_class.py 84.70% <100.00%> (+0.23%) ⬆️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants