#Joint kernel density estimate using seaborn library
import matplotlib.pyplot as plt
#conda install -c anaconda seaborn
import seaborn as sns
sns.set_theme(style="ticks")

def main():
    # Load the penguins dataset
    penguins = sns.load_dataset("penguins")

    # Show the joint distribution using kernel density estimation
    g = sns.jointplot(
        data=penguins,
        x="bill_length_mm", y="bill_depth_mm", hue="species",
        kind="kde"
        )
    plt.savefig("ex380.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