3 min read

Seaborn, the popular data visualization library, has become a very timely and relevant tool for data professionals seeking to enhance their data visualizations. The team behind Seaborn realizes this and hence have pushed the release of Seaborn v0.9.0. This version is a major release with several substantial features and notable API name changes for better consistency with matplotlib 2.0.

Three new relational plots

Seaborn v0.9.0 features three new plotting functions relplot(), scatterplot(), and lineplot().

These functions bring the high-level API of categorical plotting functions to more general plots. They can visualize a relationship between two numeric variables and map up to three additional variables by modifying hue, size, and style semantics.

replot() is a figure-level interface to the two plotting functions and combines them with a FacetGrid. The lineplot() function has support for statistical estimation and is replacing the older tsplot function. It is also better aligned with the API of the rest of the library and more flexible in showing relationships across additional variables.

For a detailed explanation of these functions with examples of the various options, go through the API reference and the relational plot tutorial.

Notable API name changes

Seaborn has renamed a few functions and made changes to their default parameters.

The factorplot function has been renamed to catplot(). The catplot() function shows the relationship between a numerical and (one or more) categorical variable using one of several visual representations. This change is expected to make catplot() easy to discover and to define its role better.

The lvplot function has been renamed to boxenplot(). The new name makes the plot more discoverable by describing its format (it plots multiple boxes, also known as “boxen”).

The size parameter to height is renamed in multi-plot grid objects (FacetGrid, PairGrid, and JointGrid) along with functions that use them (factorplot, lmplot(), pairplot(), and jointplot()). This is done to avoid conflicts with the size parameter that is used in scatterplot and lineplot functions and also makes the meaning of the parameter a bit clearer.

The default diagonal plots in pairplot() are changed to now use func:kdeplot` when a “hue” dimension is used. Also, the statistical annotation component of JointGrid is deprecated.

Themes and palettes updates

Several changes have been made to the seaborn style themes, context scaling, and color palettes to make them more consistent with the style updates in matplotlib 2.0. Here are some of the changes:

  • Some axes style()/plotting context() parameters have been reorganized and updated to take advantage of improvements in the matplotlib 2.0 update.
  • The seaborn palettes (“deep”, “muted”, “colorblind”, etc.) are updated to correspond with the new 10-color matplotlib default. A few individual colors have also been tweaked for better consistency, aesthetics, and accessibility.
  • The base font sizes in plotting context() and scaling factors for “talk” and “poster” contexts have been slightly increased.
  • Calling set() will now call set color codes() to re-assign the single letter color codes by default.

Apart from that, the introduction to the library in the documentation has been rewritten to provide more information and critical examples.

These are just a select few major updates. For a full list of features, upgrades, and improvements, read the changelog.

Read Next

What is Seaborn and why should you use it for data visualization?
Visualizing univariate distribution in Seaborn
8 ways to improve your data visualizations

Content Marketing Editor at Packt Hub. I blog about new and upcoming tech trends ranging from Data science, Web development, Programming, Cloud & Networking, IoT, Security and Game development.


Please enter your comment!
Please enter your name here