Matrix Plots
Explore Seaborn's matrix plots such as heatmaps and clustermaps to visualize data correlations and clusters. Understand how to prepare data with pivot tables and customize color maps to reveal patterns and groupings in datasets.
We'll cover the following...
Seaborn’s matrix plots, such as heatmap(), allow us to plot the data as color-encoded matrices, while clustermap() can be used to indicate clusters within the data.
Let’s learn this with examples:
The heatmap() plot
The heatmap() plot plots rectangular data as a color-encoded matrix. It’s a commonly used way of showing a matrix plot.
In order for a heatmap() to work properly, our data should already be in a matrix form. The sns.heatmap function just colors it in for us.
Being in the matrix form also means that the index name and the column name match, so the cell value actually indicates something that is relevant to both these names.
For instance, if we take a look at our tips ...