Data Visualization using seaborn in Python

1Introduction to Seaborn
2Seaborn Installation process
3Statistical plots using Seaborn
4Seaborn Color Palette

1. Introduction to Seaborn

Seaborn is a high-level data visualization library that is based on Matplotlib. It features a high-level interface that provides informational, attractive and highly presentable graphics.

Keys Features of Seaborn library:

  • Seaborn is a statistical plotting library
  • It has beautiful default styles
  • It also is designed to work very well with Pandas data frame objects

Why use Seaborn?

Seaborn allows the creation of statistical graphics through these functionalities:

  • It is an API based on datasets that allow the comparison between multiple variables
  • It supports multi-plot grids that make it easy to build complex visualizations
  • Univariate and bivariate visualizations available to compare between subsets of data
  • Availability of different color palettes to reveal various kinds of patterns
  • Fitting in and visualizing linear regression models

Seaborn vs. Matplotlib:

If Matplotlib “tries to make easy things easy and hard things possible”, Seaborn tries to make a well-defined set of hard things easy too.

                                                                                                                                     - Michael Waskom (Creator of Seaborn)

Matplotlib is good but Seaborn is better. There are basically two shortcomings of Matplotlib that Seaborn fixes:

  1. Matplotlib can be personalized but it’s quite difficult to find out what settings are required to make plots more attractive. Whereas, Seaborn comes with numerous customized themes to solve this issue.
  2. While working with Pandas, Matplotlib doesn’t serve well when it comes to dealing with DataFrames, while Seaborn functions actually work on DataFrames.

Strengths of seaborn python:

  • Using default themes that are aesthetically pleasing.
  • Setting custom color palettes.
  • Making attractive statistical plots.
  • Easily and flexibly displaying distributions.
  • Visualizing information from matrices and DataFrames.
  • Plotting statistical time-series data
  • Seaborn works well with NumPy as well as Pandas data structures
2019 Edugrad. All Rights Reserved.