Plot a Basic Correlation Matrix using Seaborn

logo of a chart:Correlogram

This post aims to show how to plot a basic correlation matrix using seaborn.

Seaborn allows you to make a correlogram or correlation matrix really easily. Correlogram is awesome for exploratory analysis: it makes you quickly observe the relationship between every variable of your matrix. It is easy to do it with seaborn: just call the pairplot() function!

# libraries
import seaborn as sns
import matplotlib.pyplot as plt

# load data set
df = sns.load_dataset('iris')

# Basic correlogram
sns.pairplot(df)
plt.show()

🚨 Grab the Data To Viz poster!


Do you know all the chart types? Do you know which one you should pick? I made a decision tree that answers those questions. You can download it for free!

    dataviz decision tree poster