Categorical Data Plots¶
- factorplot
- boxplot
- violinplot
- stripplot
- swarmplot
- barplot
- countplot
In [6]:
import seaborn as sns
%matplotlib inline
tips = sns.load_dataset('tips')
tips.head(1)
Out[6]:
barplot and countplot¶
These very similar plots allow you to get aggregate data off a categorical feature in your data. barplot is a general plot that allows you to aggregate the categorical data based off some function, by default the mean:
In [9]:
sns.barplot(x='sex',y='total_bill',data=tips)
Out[9]:
In [11]:
sns.barplot(x='sex',y='size',data=tips)
Out[11]:
In [7]:
sns.barplot(x='sex',y='total_bill',data=tips,estimator=np.std)
Out[7]:
In [4]:
import numpy as np
In [12]:
sns.barplot(x='sex',y='total_bill',data=tips,estimator=np.std)
Out[12]:
No comments:
Post a Comment