matplotlib

Create publication-quality static, animated, and interactive plots with Python's matplotlib library.

Updated Aug 12, 2026
One-click install
npx skills add https://github.com/littlt-momo-c-yfc/skills --skill matplotlib-littlt-momo-c-yfc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matplotlib
Source: https://github.com/littlt-momo-c-yfc/skills/tree/main/skills/scientific-toolkit-skill/references/scientific-skills/matplotlib
Command: npx skills add https://github.com/littlt-momo-c-yfc/skills --skill matplotlib-littlt-momo-c-yfc

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Creating customized scientific visualizations in Python requires navigating matplotlib's dual interfaces, extensive styling options, and layout quirks, which often leads to overlapping labels, wrong DPI settings, and inconsistent figure quality. ## Core Features & Use Cases - Full Plot Type Coverage: Guidance for line, scatter, bar, histogram, heatmap, contour, box, violin, polar, and 3D plots using the recommended object-oriented Figure/Axes API. - Publication-Ready Export: Best practices for saving figures to PNG, PDF, and SVG with correct DPI, tight bounding boxes, and colorblind-friendly colormaps. - Helper Scripts and References: Includes a plot template script, an interactive style configurator for generating .mplstyle files, and detailed references on plot types, styling, the API, and troubleshooting. - Use Case: A researcher needs a multi-panel figure for a journal submission; use this Skill to build a GridSpec layout, apply a publication style preset, and export at 300 DPI. ## Quick Start Ask the agent to create a multi-panel matplotlib figure with line, scatter, and heatmap subplots styled for publication and saved 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 figure with a grid of axes, then index into the returned axes array to plot on each one. For irregular layouts, use plt.subplot_mosaic or GridSpec to span rows and columns.

How do I save a matplotlib figure at high resolution?

Call plt.savefig with dpi=300 and bbox_inches='tight' for publication-quality PNG output. For scalable vector output suitable for journals, save to PDF or SVG format instead.

Should I use pyplot or the object-oriented matplotlib interface?

Use the object-oriented interface (fig, ax = plt.subplots()) for production code and multi-panel figures because it gives explicit control over figures and axes. Reserve the pyplot state-machine interface for quick interactive exploration.

Why are my matplotlib labels overlapping or cut off?

Overlapping labels happen when matplotlib's default spacing cannot fit titles, ticks, and legends. Fix it by creating the figure with constrained_layout=True, calling tight_layout(), or saving with bbox_inches='tight'.

Which colormap should I use for scientific data?

Use perceptually uniform colormaps like viridis, plasma, or cividis for sequential data, and diverging colormaps like coolwarm for data centered on a meaningful midpoint. Avoid jet because it is not perceptually uniform and misleads interpretation.

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 plot element or custom plot types.