The most widely used library for 2D (and basic 3D) plotting. It provides full control over every element of a figure, from line styles to axis spines.
Official docs: https://matplotlib.org/stable/index.html Gallery: https://matplotlib.org/stable/gallery/index.html (Essential for finding examples) Search patterns: plt.subplots, ax.settitle, ax.legend, plt.savefig, matplotlib.colors
| Object-Oriented (OO) | fig, ax = plt.subplots() | Recommended. Best for complex, reproducible plots. | | Pyplot (State-based) | plt.plot(x, y) | Quick interactive checks. Avoid for scripts/modules. |
The foundational library for creating static, animated, and interactive visualizations in Python. Highly customizable and the industry standard for publication-quality figures. Use for 2D plotting, scientific data visualization, heatmaps, contours, vector fields, multi-panel figures, LaTeX-formatted plots, custom visualization tools, and plotting from NumPy arrays or Pandas DataFrames. Source: tondevrel/scientific-agent-skills.