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

Extend new categorical ordering rules to FacetGrid #548

Merged
merged 2 commits into from
May 10, 2015

Conversation

mwaskom
Copy link
Owner

@mwaskom mwaskom commented May 10, 2015

FacetGrid now uses utils.categorical_order to determine default order for the row, color, and hue variables. This means that all categorical ordering in seaborn should follow the same rules. Please open an issue if you run into something that doesn't.

Closes #361

mwaskom added a commit that referenced this pull request May 10, 2015
Extend new categorical ordering rules to FacetGrid
@mwaskom mwaskom merged commit 325bd8d into master May 10, 2015
@mwaskom mwaskom deleted the finalize_category_order branch May 10, 2015 18:59
@Bharat05
Copy link

Bharat05 commented Feb 5, 2017

I was expecting seaborn to sort the categorical variable on x-axis. Please help.

titanic_df = pd.read_csv('train.csv') #from Kaggle Titanic Dataset
deck = titanic_df['Cabin'].dropna()
levels = []
for level in deck:
    levels.append(level[0])
cabin_df = DataFrame(levels)
cabin_df.columns = ['Cabin']
sns.factorplot('Cabin', data = cabin_df, palette = 'summer', kind = 'count')

image

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.

Seaborn should respect categorical order when sorting pd.Categorical objects
2 participants