条形图上的回归拟合#

使用的 seaborn 组件: set_theme()
, load_dataset()
, catplot()
, regplot()
import seaborn as sns
sns.set_theme()
mpg = sns.load_dataset("mpg")
sns.catplot(
data=mpg, x="cylinders", y="acceleration", hue="weight",
native_scale=True, zorder=1
)
sns.regplot(
data=mpg, x="cylinders", y="acceleration",
scatter=False, truncate=False, order=2, color=".2",
)