As noted in the beginning, `seaborn` is built on top of `pandas` and `matplotlib`, so everything that is acheivable via `seaborn` is achievable using a -- not so straightforward -- combination of the other two. But the magic of `seaborn` is that it makes the job of producing various publication-quality figures magnitudes of orders easier.

As noted in the beginning, `seaborn` is built on top of `pandas` and `matplotlib`, so everything that is acheivable via `seaborn` is achievable using a -- not so straightforward -- combination of the other two. But the magic of `seaborn` is that it makes the job of producing various publication-quality figures orders of magnitudes easier.

Let's start by plotting the same scatterplot, but this time via `seaborn`. To do this, we have to pass the names of columns of interest to the `x` and `y` parameters corresponding to the horizontal and vertical axes.

# plot the joint histograms, overlayed with kernel density estimates

g.plot_marginals(sns.histplot,kde=True)

g.plot_marginals(sns.distplot,kde=False,

bins=np.logspace(np.log10(1),np.log10(5000),30))

```

%% Cell type:markdown id:restricted-damages tags:

---

...

...

@@ -385,24 +386,37 @@

## Pairwise relationships

<aid='pair'></a>

`seaborn` also provides a convenient tool to have an overview of the relationships among each pair of the columns in a large table using `pairplot`. This could hint to potential dependencies among variables.

Lets see the overview of the pairwise relationships in the 🐧 dataset.

Lets see the overview of the pairwise relationships in a dataset that contains the data on iris flowers 🌸.

%% Cell type:code id:fancy-trial tags:

``` python

iris=sns.load_dataset('iris')

```

%% Cell type:code id:medium-department tags:

``` python

iris

```

%% Cell type:code id:boolean-mineral tags:

``` python

sns.pairplot(penguins)

sns.pairplot(iris)

```

%% Cell type:markdown id:pressed-clone tags:

By default, scatterplots are used to show the distribution of each pair, and histograms of marginal distributions are shown on the diagonal. Note, however, that the upper-diagonal, lower-diagonal, and diagonal plots can be modified independently. For instance, we can plot the linear regression lines in the upper-diagonal plots using `regplot`, marginal histograms on the diagonals using `hist`, and kernel density estimates in the lowe-diagonal plots using `kdeplot`.

By default, scatterplots are used to show the distribution of each pair, and histograms of marginal distributions are shown on the diagonal. Note, however, that the upper-diagonal, lower-diagonal, and diagonal plots can be modified independently. For instance, we can plot the linear regression lines in the upper-diagonal plots using `regplot`, marginal histograms on the diagonals using `kdeplot`, and kernel density estimates in the lower-diagonal plots also using `kdeplot`.