# matplotlib

A skill that guides the agent through Matplotlib: building scientific plots, tuning axes and legends, and exporting figures to PNG, PDF or SVG.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 2200 installs · ★ 54652
- Author: K-Dense-AI
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/K-Dense-AI/scientific-agent-skills/tree/HEAD/skills/matplotlib/SKILL.md
- Updated: 2026-10-19
- HTML: https://affpapa.org/en/nevibecode/skills/k-dense-ai-matplotlib

## What it does

The skill tells the agent how to work with Matplotlib — which interface to pick, how to lay out several axes in one figure, how to label axes and legends. It ships examples for line charts, scatter plots, histograms, heatmaps, contours and box plots, plus scripts the agent can run through Bash.

You need Python 3.11+ and Matplotlib 3.11.2. The examples also pull in NumPy and SciPy, some use pandas, and Jupyter widgets need ipympl. Installing packages requires network access; drawing locally needs no credentials.

File output runs without a GUI. For batch scripts set `MPLBACKEND=Agg`, or select Agg before importing pyplot. Interactive windows need an installed GUI toolkit such as PySide6 (`QtAgg`) or a working Tk (`TkAgg`), and `plt.ioff()` will not drop the GUI thread requirement. Migrating older code? Check the 3.11 API changes: box plots now take `tick_labels` and `orientation`, and colormaps come from `mpl.colormaps[name]`.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add K-Dense-AI/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 K-Dense-AI/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 K-Dense-AI/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 K-Dense-AI/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 K-Dense-AI/scientific-agent-skills --skill matplotlib -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/K-Dense-AI/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 K-Dense-AI/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/K-Dense-AI/scientific-agent-skills/tree/HEAD/skills/matplotlib/SKILL.md

## When to use it
- plot a line chart or scatter plot from an array
- assemble a multi-panel figure from several axes
- tune colors, labels and legends for a journal
- save a figure as PNG, PDF or SVG for publication
- draw a heatmap or contour plot from a matrix

## Example prompts
- Plot sin(x) and cos(x) on one figure and save it to `plot.png` with dpi=300
- Build a 2 by 2 grid of four different charts and label the axes
- Draw a heatmap from this matrix and add a colorbar

## Similar
- [anysearch](https://affpapa.org/en/nevibecode/skills/anysearch.md) — skill · 38500 installs
- [academic-paper](https://affpapa.org/en/nevibecode/skills/academic-paper.md) — skill · 10800 installs
- [nature-figure](https://affpapa.org/en/nevibecode/skills/nature-figure.md) — skill · 18800 installs
- [academic-paper-reviewer](https://affpapa.org/en/nevibecode/skills/academic-paper-reviewer.md) — skill · 9800 installs
- [nature-polishing](https://affpapa.org/en/nevibecode/skills/nature-polishing.md) — skill · 17500 installs
- [nature-citation](https://affpapa.org/en/nevibecode/skills/nature-citation.md) — skill · 15600 installs

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

From the same set: [k-dense-ai/scientific-agent-skills](https://affpapa.org/en/nevibecode/by/k-dense-ai/scientific-agent-skills.md) — 159 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
