%matplotlib inline
A Jupyter magic that renders matplotlib plots as static PNG images inline below the cell.
- Default in Jupyter; explicit in some setups.
- %matplotlib widget gives interactive HTML5 canvas.
- Only affects subsequent figures.
When to use: Whenever you want plots rendered in the notebook (vs. opening separate windows).
Example: %matplotlib inline; import matplotlib.pyplot as plt; plt.plot([1,2,3]) → inline static plot.