matplotlib

Create static, animated, and interactive plots in Python with matplotlib.

Updated Sep 2, 2026
One-click install
npx skills add https://github.com/ricfulop/cba-agentic-engineering-bootstrap --skill matplotlib-ricfulop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matplotlib
Source: https://github.com/ricfulop/cba-agentic-engineering-bootstrap/tree/main/skills/matplotlib
Command: npx skills add https://github.com/ricfulop/cba-agentic-engineering-bootstrap --skill matplotlib-ricfulop

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires matplotlib, numpy, scipy, and includes scripts (resource) and references (resource) components.

What problem does it solve? Creating publication-quality charts and scientific visualizations in Python requires knowing matplotlib's dual interfaces, layout system, and export options, which is error-prone without structured guidance. ## Core Features & Use Cases - Full Plot Type Coverage: Line, scatter, bar, histogram, heatmap, contour, box, violin, polar, and 3D plots with copy-ready code patterns. - Styling and Layout Control: rcParams configuration, style sheets, colormap selection, GridSpec multi-panel layouts, and constrained layout guidance. - Publication Export: Save figures to PNG, PDF, or SVG at 300 DPI with tight bounding boxes for journals and presentations. - Use Case: A researcher needs a multi-panel figure combining a line plot, heatmap, and histogram for a journal submission; the skill provides the GridSpec layout, styling presets, and export settings in one workflow. ## Quick Start Ask the AI to create a publication-quality multi-panel matplotlib figure from your data and export it as a 300 DPI PNG.

Frequently Asked Questions about matplotlib

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create subplots in matplotlib?

Use plt.subplots(nrows, ncols) to create a grid of axes, or GridSpec and subplot_mosaic for complex layouts where panels span multiple rows or columns. The object-oriented interface with explicit axes references is recommended over the pyplot state machine.

What is the difference between pyplot and the object-oriented matplotlib API?

The pyplot interface maintains implicit global state and suits quick interactive plots, while the object-oriented API explicitly creates Figure and Axes objects. The OO interface is recommended for production code, multi-panel figures, and maintainable scripts.

How do I save matplotlib figures at high resolution for publication?

Call plt.savefig with dpi=300 and bbox_inches='tight' to remove excess whitespace. Use PDF or SVG for vector output that scales without quality loss, and PNG with facecolor='white' for raster output.

Why are my matplotlib labels overlapping or cut off?

Overlapping labels happen when the default layout lacks spacing. Fix it by creating figures with constrained_layout=True, calling tight_layout(), or saving with bbox_inches='tight' so all text fits within the exported bounds.

Which colormap should I use for scientific data in matplotlib?

Use perceptually uniform colormaps like viridis, plasma, or cividis for sequential data, and diverging maps like coolwarm for data centered on zero. Avoid jet, which distorts perception and is not colorblind-friendly.

When should I use seaborn or plotly instead of matplotlib?

Use seaborn for quick statistical plots with sensible defaults and plotly for interactive web-based visualizations. Matplotlib is the right choice when you need fine-grained control over every element or custom plot types.