Histogramas bivariados con displot() —#

  • 0:00 min | Última modificación: Octubre 13, 2021 | [YouTube]

[1]:
import matplotlib.pyplot as plt
import seaborn as sns
[2]:
penguins = sns.load_dataset("penguins")
[3]:
#
# Heatmap básico
#
sns.displot(
    penguins,
    x="bill_length_mm",
    y="bill_depth_mm",
    binwidth=(2, 0.5),
    cbar=True,
    rug=True,
    kind='hist',
)
plt.show()
../../_images/02_seaborn_notebooks_3-33_distributions-displot_hist_bivariate_3_0.png
[4]:
#
# Heatmap por variable categórica.
#
sns.displot(
    penguins,
    x="bill_length_mm",
    y="bill_depth_mm",
    binwidth=(2, 0.5),
    hue="species",
    rug=True,
    kind='hist',
)
plt.show()
../../_images/02_seaborn_notebooks_3-33_distributions-displot_hist_bivariate_4_0.png