displot visualizes the distribution of observations with Seaborn. For a weather DataFrame, it can show how maximum temperatures are distributed across all cities. section 11.16
Use the function to compare distributions in progressively more informative ways:
- Plot a histogram with max_temp on the x-axis. section 11.16
- Add hue='city' to distinguish each city's distribution by color. section 11.16
- Add row='city' to place each city's histogram in a separate plot. section 11.16
Compare city temperatures
sns.displot(x='max_temp', data=df, hue='city', row='city') produces city-specific histograms, using color and separate rows to make the distributions easier to compare. section 11.16
sns.displot(x='max_temp', data=df)
Start with the simplest distribution plot before adding categorical color or faceting. section 11.16
