# matplotlib

A skill that tells your agent how to build matplotlib figures: line and scatter plots, heatmaps, multi-panel layouts. Useful when the data sits in NumPy or Pandas and the output goes into a paper or report.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 374 installs · ★ 24
- Author: tondevrel
- License: PSF · policy=link-only · description only; the file stays with the author
- Source: https://github.com/tondevrel/scientific-agent-skills/tree/HEAD/skills/matplotlib/SKILL.md
- Updated: 2026-02-01
- HTML: https://affpapa.org/en/nevibecode/skills/tondevrel-matplotlib

## What it does

The skill walks through the object-oriented interface: `fig, ax = plt.subplots()`, then axis labels, legends, ticks and saving. It ships patterns for lines, scatter, bars, histograms, heatmaps with a colorbar, contours, vector fields and 3D surfaces. Multi-panel figures get their own section, from a plain `plt.subplots(2, 2)` grid to `gridspec.GridSpec` with uneven cell ratios.

Publication styling is covered too: LaTeX labels via `text.usetex`, global settings through `plt.rcParams.update`, export to `.pdf` or `.svg`. The skill advises `bbox_inches='tight'` on save and dpi 300+ for print, and closing figures with `plt.close('all')` inside loops to avoid memory leaks. On colormaps it is blunt: `jet` fakes gradients, so use `viridis`, `magma` or `inferno`.

Interactive web dashboards and quick statistical exploration are out of scope — the skill points you to Plotly, Bokeh and Seaborn instead. Very large real-time datasets are out too. Install the skill with `npx skills add`; matplotlib itself comes from `pip install matplotlib`.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add tondevrel/scientific-agent-skills --skill matplotlib -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/matplotlib/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/matplotlib/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add tondevrel/scientific-agent-skills --skill matplotlib -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/matplotlib/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add tondevrel/scientific-agent-skills --skill matplotlib -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/matplotlib/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install tondevrel/scientific-agent-skills matplotlib
```

2. **Manually: put the files in place**
- File: `.github/skills/matplotlib/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add tondevrel/scientific-agent-skills --skill matplotlib -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/tondevrel/scientific-agent-skills --path skills/matplotlib
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/matplotlib/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add tondevrel/scientific-agent-skills --skill matplotlib -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/tondevrel/scientific-agent-skills/tree/HEAD/skills/matplotlib/SKILL.md

## When to use it
- plot a NumPy array without hand-tuning every axis
- assemble a multi-panel figure with uneven cell sizes
- export a figure to PDF without clipped labels
- label axes with LaTeX formulas for a paper
- draw a heatmap with a properly aligned colorbar

## Example prompts
- plot sin(x) from 0 to 10 and save it as plot.pdf
- build a 2x2 grid with a heatmap, a histogram and an errorbar plot
- set rcParams so axis labels render in LaTeX, then plot the data

## Similar
- [matplotlib-best-practices](https://affpapa.org/en/nevibecode/skills/matplotlib-best-practices.md) — skill · 1000 installs
- [data-analysis-jupyter](https://affpapa.org/en/nevibecode/skills/data-analysis-jupyter.md) — skill · 1500 installs
- [seaborn](https://affpapa.org/en/nevibecode/skills/k-dense-ai-seaborn.md) — skill · 2100 installs
- [academic-plotting](https://affpapa.org/en/nevibecode/skills/academic-plotting.md) — skill · 1200 installs
- [mathmodel-figure-templates](https://affpapa.org/en/nevibecode/skills/mathmodel-figure-templates.md) — skill · 1700 installs
- [data-science-expert](https://affpapa.org/en/nevibecode/skills/data-science-expert.md) — skill · 573 installs

## Other versions with the same name
- [matplotlib · k-dense-ai](https://affpapa.org/en/nevibecode/skills/k-dense-ai-matplotlib.md) — 2200 installs
- [matplotlib · davila7](https://affpapa.org/en/nevibecode/skills/matplotlib.md) — 257 installs

From the same set: [tondevrel/scientific-agent-skills](https://affpapa.org/en/nevibecode/by/tondevrel/scientific-agent-skills.md) — 3 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
