Updated On : Jan-23,2019 Tags datascience, datavisulisation, seaborn
Seaborn - Working On Visualizing Pairwise Relationship

Seaborn - Working On Visualising Pairwise Relationship

Datasets under real-time study contain many variables. In such cases, the relation between each and every variable should be analyzed. Plotting Bivariate Distribution for (n,2) combinations will be a very complex and time taking process.

To plot multiple pairwise bivariate distributions in a dataset, you can use the pairplot() function. This shows the relationship for (n,2) combination of a variable in a DataFrame as a matrix of plots and the diagonal plots are the univariate plots.

Axes In this section, we will learn what are Axes, their usage, parameters, and so on.

Usage

seaborn.pairplot(data,…)

Parameters

Following table lists down the parameters for Axes −

Sr.No. Parameter & Description

  • Data

Dataframe

  • Hue

Variable in data to map plot aspects to different colors.

  • Palette

Set of colors for mapping the hue variable

  • Kind

Kind of plot for the non-identity relationships. {‘scatter’, ‘reg’}

  • Diag_kind

Kind of plot for the diagonal subplots. {‘hist’, ‘kde’}

Except data, all other parameters are optional. There are few other parameters which pairplot can accept. The above mentioned are often used params.

In [1]:
import pandas as pd
import seaborn as sb
from matplotlib import pyplot as plt
df = sb.load_dataset('iris')
sb.set_style("ticks")
sb.pairplot(df,hue = 'species',diag_kind = "kde",kind = "scatter",palette = "husl")
plt.show()

  Support Us to Make a Difference

Thank You for visiting our website. If you like our work, please support us so that we can keep on creating new tutorials/blogs on interesting topics (like AI, ML, Data Science, Python, Digital Marketing, SEO, etc.) that can help people learn new things faster. You can support us by clicking on the Coffee button at the bottom right corner. We would appreciate even if you can give a thumbs-up to our article in the comments section below.

 Want to Share Your Views? Have Any Suggestions?

If you want to

  • provide some suggestions on topic
  • share your views
  • include some details in tutorial
  • suggest some new topics on which we should create tutorials/blogs
Please feel free to let us know in the comments section below (Guest Comments are allowed). We appreciate and value your feedbacks.



Dolly Solanki  Dolly Solanki