Seaborn is a data visualization library in Python that provides various functions for different charts and plots.
Refer to Seaborn library in Python to learn more about seaborn.
A pair plot is a plot of subplots where each subplot represents a bivariate distribution of two variables in the given dataset.
Here is an example of a pair plot for the iris dataset:
seaborn.pairplot(data, hue=None, x_vars=None, y_vars=None, kind='scatter', diag_kind='auto', dropna=False)
data
: This is a pandas DataFrame where each column is a variable and each row is an observation.hue
: This is a variable in data to map to different colors.x_vars
, y_vars
: These are the variables in the data to be used separately for the rows and columns of the plot.kind
: This is the kind of plot to be made. Its values can be scatter
, kde
, hist
, or reg
.diag_kind
: This is the kind of plot for the diagonal subplots. Its values can be auto
, hist
, kde
, or None
.dropna
: This is a boolean value that indicates whether to drop the missing values before plotting.import seaborn as snsimport matplotlib.pyplot as plttaxis = sns.load_dataset("taxis")p_plot = sns.pairplot(taxis)plt.savefig("output/plot.png")
seaborn
and matplotlib
libraries.seaborn
library provides a predefined set of datasets. The different datasets can be found in seaborn datasets. One such dataset is the taxis dataset. The dataset is loaded into memory using the load_dataset()
function.pairplot()
for the taxis dataset.plot.png
.Free Resources