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.
seaborn.pairplot(data,…)
Following table lists down the parameters for Axes −
Sr.No. Parameter & Description
Dataframe
Variable in data to map plot aspects to different colors.
Set of colors for mapping the hue variable
Kind of plot for the non-identity relationships. {‘scatter’, ‘reg’}
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.
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()
If you are more comfortable learning through video tutorials then we would recommend that you subscribe to our YouTube channel.
When going through coding examples, it's quite common to have doubts and errors.
If you have doubts about some code examples or are stuck somewhere when trying our code, send us an email at coderzcolumn07@gmail.com. We'll help you or point you in the direction where you can find a solution to your problem.
You can even send us a mail if you are trying something new and need guidance regarding coding. We'll try to respond as soon as possible.
If you want to