#Regression fit over a strip plot
import matplotlib.pyplot as plt
#conda install -c anaconda seaborn
import seaborn as sns
sns.set_theme()


def main():
    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",
    )
    plt.savefig("ex375.png", dpi=100)
    plt.show()

if __name__ == '__main__':
    main()

Discover more from Tips and Hints for Aerospace Engineers

Subscribe now to keep reading and get access to the full archive.

Continue reading