Seaborn: countplot orient not working

Created on 24 Jul 2015  路  5Comments  路  Source: mwaskom/seaborn

Hi,
The code in IPython notebook:

%matplotlib inline
import pandas as pd
import seaborn as sns
df = pd.DataFrame([[2], [2], [1], [1], [1], [3]])
sns.countplot(x=0, data=df, orient='v')
sns.countplot(x=0, data=df, orient='h')

produces exactly the same output plots. This means that the option for orienting is not working.

Most helpful comment

You have to do

sns.countplot(y=0, data=df)

(that is, y=0 instead of x=0. When plotting with long-form data, the assignment of variables in the dataframe to plot axes supersedes the orient keyword argument.

All 5 comments

You have to do

sns.countplot(y=0, data=df)

(that is, y=0 instead of x=0. When plotting with long-form data, the assignment of variables in the dataframe to plot axes supersedes the orient keyword argument.

Thanks a lot, I did not expected :).

Hey, thanks a lot. It helped me today!

Worked like a charm! Thanks :)

helped me too...... THANKS.... :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

phantom0301 picture phantom0301  路  3Comments

btyukodi picture btyukodi  路  3Comments

sofiatti picture sofiatti  路  4Comments

JanHomann picture JanHomann  路  3Comments

amelio-vazquez-reina picture amelio-vazquez-reina  路  3Comments