# Why is the correlation of a variable and itself a histogram?

This post is visualizing the Wine dataset.

You may have noticed that the figures along the diagonal look different. They are histograms of values of individual variables. We can see that the "Ash" and "Alcalinity of ash" variables are roughly normally distributed.

Here is the first figure along the diagonal.

Consider the Alcohol column, is the correlation of Alcohol and itself the histogram or just for programming convenience?

• A scatter plot (in my reading a more common term than correlation plot) of a variable against itself would be informative, as it shows the distribution of that variable on the diagonal $y = x$. You would certainly see marked outliers and perhaps other features too, depending partly on the number in the sample. But a histogram or density plot is often easier to think about. – Nick Cox Sep 18 at 15:41

Seaborn's pairplot gives out what's called a "correlation plot" (see another example using MATLAB here). Since a correlation of a variable $$X$$ and itself is always one, there's little use displaying this. So by convention these plots plot out the variable's histogram/distribution instead. This is also noted in the function's documentation:

The diagonal Axes are treated differently, drawing a plot to show the univariate distribution of the data for the variable in that column.

• Thanks for your answer. In the context of "Alcohol", is the figure in my post a histogram plot? – whnlp Sep 18 at 5:40
• It's an empirical distribution, which is more or less a continuous version of the histogram. You might look up "kernel density estimation", "distribution", and "histogram" for more info. – Art Sep 18 at 6:14
• Thanks a lot. Could you help to take a loot at this how “empirical distribution histogram” relates to “histogram”? – whnlp Sep 18 at 10:22