Subplots & Layouts

• plt.subplot() — The simple way • plt.subplots() — The modern OOP way • 2D grid — axs[row, col] indexing • sharex / sharey — Honest comparison across panels • Figure size & spacing — figsize, tight_layout, subplots_adjust • GridSpec — Non-uniform layouts • Mixed chart types — Four panels, four stories • axs.flat — Looping over all panels • fig.suptitle() — Master title for multi-panel figures • Twin axes — Two scales, one chart • Inset axes — Zoom into a region • Real-world — A 4-panel sales dashboard • Generating many panels in a loop