Matplotlib - An introduction of two interfaces.
for an Evening of Python Coding September 18, 2018
Object-Oriented API vs Pyplot
Matplotlib has two interfaces. The first is an object-oriented (OO) interface. In this case, we utilize an instance of axes.Axes in order to render visualizations on an instance of figure.Figure.
The second is based on MATLAB and uses a state-based interface. This is encapsulated in the pyplot module. See the pyplot tutorials for a more in-depth look at the pyplot interface.
Note
In general, try to use the object-oriented interface over the pyplot interface.
from https://matplotlib.org/tutorials/introductory/lifecycle.html