In this recipe, we will learn the difference between pyplot and an object-oriented APIs. We will plot the same correlation matrix, first with the pyplot API and then with an object-oriented API. We will use the same Wine Quality dataset for plotting the correlation matrix.
Plotting a correlation matrix using pyplot and object-oriented APIs
Getting ready
Import the following libraries for the pyplot API:
import pandas as pd
import matplotlib.pyplot as plt
Import the following libraries for an object-oriented API:
import pandas as pd
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure
from IPython.core.display import display
matplotlib.backends has a set of backends that...