In [1]:
import numpy as np
from numpy.random import randn
import pandas as pd
from scipy import stats
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
In [2]:
tips = sns.load_dataset('tips')
In [3]:
sns.lmplot('total_bill', 'tip', tips)
Out[3]:
In [4]:
sns.lmplot('total_bill', 'tip',
tips, scatter_kws={'marker':'o', 'color': 'red'},
line_kws={'linewidth':1, 'color': 'blue'})
Out[4]:
In [5]:
sns.lmplot('total_bill', 'tip', tips, order='4',
scatter_kws={'marker':'o', 'color': 'red'},
line_kws={'linewidth':1, 'color': 'blue'})
Out[5]:
In [6]:
sns.lmplot('total_bill', 'tip', tips, fit_reg=False)
Out[6]:
In [7]:
tips['tip_pect'] = 100* (tips['tip']/tips['total_bill'])
In [8]:
tips.head()
Out[8]:
In [9]:
sns.lmplot('size', 'tip_pect', tips)
Out[9]:
In [10]:
sns.lmplot('size', 'tip_pect', tips, x_jitter=.1)
Out[10]:
In [11]:
sns.lmplot('size', 'tip_pect', tips, x_estimator=np.mean)
Out[11]:
In [12]:
sns.lmplot('total_bill', 'tip_pect', tips, hue='sex', markers=['x', 'o'])
Out[12]:
In [13]:
sns.lmplot('total_bill', 'tip_pect', tips, hue='day')
Out[13]:
In [14]:
sns.lmplot('total_bill', 'tip_pect', tips, lowess=True, line_kws={'color': 'black'})
Out[14]:
In [15]:
sns.regplot('total_bill', 'tip_pect', tips)
Out[15]:
In [19]:
fig, (axis1, axis2) = plt.subplots(1, 2, sharey=True)
sns.regplot('total_bill', 'tip_pect', tips, ax=axis1)
sns.violinplot(x = tips['tip_pect'], y = tips['size'])
Out[19]:
In [ ]: