plt.subplot() or plt.subplots()? Understanding state-based vs. object-oriented programming in Pyplot

How to tame Matplotlib’s two-headed monster to achieve the data visualization results you want

Kaleb Nyquist
Towards Data Science
7 min readJul 18, 2020

--

When I was learning how to code using the Python programming language, the introduction of the Pyplot module (part of the Matplotlib library, here referred to by the alias plt) was particularly non-intuitive…and, honestly, kind of disorientating. For example, the functions plt.subplot() and plt.subplots()

--

--

Data-Driven Strategist for Sustainability, Spirituality, & Political Reform