seaborn_altair.regplot

import seaborn as sns
import seaborn_altair as salt
import numpy as np; np.random.seed(8)
sns.set(color_codes=True)
tips = sns.load_dataset("tips")
ans = sns.load_dataset("anscombe")
mean, cov = [4, 6], [(1.5, .7), (.7, 1)]
x, y = np.random.multivariate_normal(mean, cov, 80).T
display(salt.regplot(x="total_bill", y="tip", data=tips))
ax = sns.regplot(x="total_bill", y="tip", data=tips)
display(salt.regplot(x=x, y=y, color="g"))
ax = sns.regplot(x=x, y=y, color="g")
import pandas as pd
x, y = pd.Series(x, name="x_var"), pd.Series(y, name="y_var")
display(salt.regplot(x=x, y=y))
ax = sns.regplot(x=x, y=y, marker="+")
display(salt.regplot(x=x, y=y, ci=68))
ax = sns.regplot(x=x, y=y, ci=68)
display(salt.regplot(x="size", y="total_bill", data=tips))
ax = sns.regplot(x="size", y="total_bill", data=tips, x_jitter=.1)
display(salt.regplot(x="size", y="total_bill", data=tips, x_estimator=np.mean))
ax = sns.regplot(x="size", y="total_bill", data=tips, x_estimator=np.mean)
display(salt.regplot(x=x, y=y, x_bins=4))
ax = sns.regplot(x=x, y=y, x_bins=4)
display(salt.regplot(x="x", y="y", data=ans.loc[ans.dataset == "II"], scatter_kws={"s": 80}, order=2, ci=None, truncate=True))
ax = sns.regplot(x="x", y="y", data=ans.loc[ans.dataset == "II"], scatter_kws={"s": 80}, order=2, ci=None, truncate=True)
display(salt.regplot(x="x", y="y", data=ans.loc[ans.dataset == "III"], scatter_kws={"s": 80}, robust=True, ci=None))
ax = sns.regplot(x="x", y="y", data=ans.loc[ans.dataset == "III"], scatter_kws={"s": 80}, robust=True, ci=None)
tips["big_tip"] = (tips.tip / tips.total_bill) > .175
display(salt.regplot(x="total_bill", y="big_tip", data=tips, logistic=True, n_boot=500))
ax = sns.regplot(x="total_bill", y="big_tip", data=tips, logistic=True, n_boot=500, y_jitter=.03)
display(salt.regplot(x="size", y="total_bill", data=tips, x_estimator=np.mean, logx=True, truncate=True))
ax = sns.regplot(x="size", y="total_bill", data=tips, x_estimator=np.mean, logx=True, truncate=True)