Seaborn is a high-level Python data visualization library built on Matplotlib. It makes it convenient to create many different informative statistical visualizations.

The new version (0.11.0) of Seaborn just released with new features and enhancements on the existing ones. In this post, we will cover most of the changes with sample visualizations.
Three new functions have been introduced which are displot, histplot, and ecdfplot. These three functions can be used to visualize univariate or bivariate data distributions.
Note: In order to use the new features, you need to update to the new version which can be done with pip install seaborn==0.11.0
.
Let’s start with the distplot. It can be considered as the parent class of the other two. The distplot, using the kind parameter, provides access to histplot, ecdfplot, and kdeplot. Thus, it is a figure-level interface for different kinds of distribution plots.
Here is an example.
sns.displot(data=diabetes, x='Glucose', kind='hist', height=6, aspect=1.2)

We’ve plotted a histogram showing the univariate distribution of the glucose variable.
The following code will create a histogram that shows the bivariate distribution of the glucose and blood pressure variables.
sns.displot(data=diabetes, x='Glucose', y='BloodPressure',
kind='hist', height=6, aspect=1.2)

The darkness of regions increases with the number of data points within that region.
The distplot is a figure-level function whereas the histplot is an axes-level function. The same plot can be created with the following syntax of histplot function.
sns.histplot(data=diabetes, x='Glucose', y='BloodPressure')
If you’d like to learn more about Figure and Axes concepts of Matplotlib, here is a detailed post about the structure of Matplotlib.
Since displot draws figures on a FacetGrid, we can have multiple plots on the same figure.
sns.displot(data=churn, x='CreditScore', kind='hist',
col='Geography', hue='Exited')

The ecdfplot (Empirical Cumulative Distribution Functions) provides the proportion or count of observations falling below each unique value in a dataset. In addition to an overview of the distribution of variables, we get a more clear view of each observation in the data compared to a histogram because there is no binning (i.e. grouping).
sns.displot(data=churn, x='Age', kind='ecdf', col='Geography', hue='Exited')

The ecdfplot can only plot univariate distributions.
The new version comes with a depreciated function which is the distplot. It is kind of expected because the new functions (displot and histplot) seem to be better replacements for displot.
There are also improvements or enhancements on some of the currently used functions.
The jointplot provides univariate and bivariate plots of two variables. The hue semantic is added to jointplot which adds extra informative power.
sns.jointplot(data=diabetes, x='Insulin', y='BMI', hue='Outcome',
height=7)

Another addition to the jointplot is the "hist" option to the kind parameter. The default value of the kind parameter is "scatter" but if we change it as "hist", bivariate histogram on the joint axes and univariate histograms on the marginal axes are created.
sns.jointplot(data=diabetes, x='Insulin', y='BMI', hue='Outcome',
kind='hist', height=7)

Some highlights about the API
Set
function has been renamed asset_theme
. It adjusts several properties of the theme used in visualizations.- The
axlabel
function is no longer available. It is recommended to useax.set(xlabel=, ylabel=)
instead.
We have covered some of the major changes but if you’d like to see all the changes, here is the related seaborn documentation.
If you’d like to practice yourself, you can access to the datasets on Kaggle.
Thank you for reading. Please let me know if you have any feedback.