doc/_docstrings/regplot.ipynb
import numpy as np
import seaborn as sns
sns.set_theme()
mpg = sns.load_dataset("mpg")
sns.regplot(data=mpg, x="weight", y="acceleration")
sns.regplot(data=mpg, x="weight", y="mpg", order=2)
sns.regplot(data=mpg, x="displacement", y="mpg", logx=True)
sns.regplot(data=mpg, x="horsepower", y="mpg", lowess=True)
sns.regplot(x=mpg["weight"], y=mpg["origin"].eq("usa").rename("from_usa"), logistic=True)
sns.regplot(data=mpg, x="horsepower", y="weight", robust=True)
sns.regplot(data=mpg, x="weight", y="horsepower", ci=None)
sns.regplot(data=mpg, x="cylinders", y="weight", x_jitter=.15)
sns.regplot(data=mpg, x="cylinders", y="acceleration", x_estimator=np.mean, order=2)
sns.regplot(data=mpg, x="weight", y="mpg", x_bins=np.arange(2000, 5500, 250), order=2)
sns.regplot(
data=mpg, x="weight", y="horsepower",
ci=99, marker="x", color=".3", line_kws=dict(color="r"),
)