Correlogram

⏱ Quick start

Once more, the Seaborn library is here to build a high quality correlogram with a few lines of code only.🔥

Note that all the stuff you learned in the scatterplotand histogram sections can be used here.

# library & dataset
import seaborn as sns
df = sns.load_dataset('iris')
import matplotlib.pyplot as plt

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

Seaborn logoCorrelogram with Seaborn

Seaborn is definitely the best way to build a correlogram with python. It provides a pairplot() function that handles most of the work for you. The examples below give an overview of the customizations you can apply to it to suits your need.

Matplotlib logoCorrelogram with Matplotlib

As usual it is totally possible to build the chart with Matplotlib, but requires to write a bit more code. Basically, it is done using the subplots() function to create the grid, and next building a loop to add the charts one by one.

Note that a correlogram is an aggregate of scatterplots and histograms. Most of the customizations described in those related sections can be applied here.