-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Setting the order of boxes in sns.boxplot() #14
Comments
Uh oh, that sounds like a bug. Let me look into it. |
If you need sample data to replicate, please let me know. I am happy to On 21 Nov 2013, at 12:08, Michael Waskom wrote:
|
Indeed, it looks like the boxes end up in the alphabetical order of the grouping variable, but the xlabel names end up in the order they appear in the Series. I have replicated it in this gist. For the time being, you can specify the Thanks for reporting this! I'll open a PR to fix it tonight. |
You are fast, my friend. Like lightning. On 21 Nov 2013, at 12:19, Michael Waskom wrote:
|
Fixed in master! |
Shall I put in another feature request for the ability to easily specify the order of the boxplot? |
Sure, go ahead and open a separate issue for that. This fix reminded me that there is a lot of gross repeated code in the setup for boxplot and violin that should be abstracted out. I probably will add the ordering when I get to that, otherwise it will just add more messiness. In the meantime, you could do (extending the gist example):
as a workaround. |
Love what you are doing with this visualization library.
I am having a hard time, though, figuring out how to set the order for a groupby boxplot. The order of the boxes seems to follow the sorted order of the groupby functionality, alphabetical when I am grouping by genotype. Labels on the boxes, however, seem to follow the order the data take in the dataframe. This leads to mislabeled plots.
Is there a way to specify the order in which the boxes appear?
The text was updated successfully, but these errors were encountered: