Robots Atlas>ROBOTS ATLAS

Python — From Basics to Advanced · Matplotlib and Seaborn — Data Visualization

Figure, Axes and the matplotlib architecture

Matplotlib and Seaborn — Data Visualization

Introduction

Matplotlib has two API styles: the stateful pyplot (plt.*) and the object-oriented Figure + Axes. The lesson begins with the object hierarchy — a Figure is the whole canvas, an Axes is a single plot with axes, legend, and title. It shows why fig, ax = plt.subplots() is the preferred idiom, how to manage multi-subplot layout (tight_layout, constrained_layout, sharex/sharey, GridSpec) and how to control resolution and size (figsize, dpi). After it you can knowingly pick between plt.title() and ax.set_title() and recognise when each is a trap.