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

Added 'level_order' for custom ordering in stacked_barplot #19

Merged
merged 4 commits into from
Feb 12, 2021

Conversation

redst4r
Copy link
Contributor

@redst4r redst4r commented Feb 12, 2021

Hi,

just added an option to customize the order in which the different levels (x-axis) in stacked_barplot() are plotted.

Ideally, the ordering would be encoded using pd.Categorical for the data.obs[feature_name] column and its inherent order, but the plotting code is currently agnostic of that.

@johannesostner
Copy link
Collaborator

Hi! Thanks for this PR!

I really like this idea, allowing people to change the order of bars within the plotting function is often much more convenient than sorting the dataset beforehand.

I would also like to incorporate pd.Categorical's inherent ordering, as you mentioned. The ordering priority for a categorical covariate should be level_order > inherent order > order in the dataset.
For this, I will switch the target of this PR to our current release branch, and merge it there. The feature will then be released with the 0.1.2 version.

@johannesostner johannesostner changed the base branch from master to revision_0.1.2 February 12, 2021 13:17
@johannesostner johannesostner merged commit aff2ebc into theislab:revision_0.1.2 Feb 12, 2021
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

Successfully merging this pull request may close these issues.

3 participants