# matplotlib

A Claude skill for matplotlib: line plots, scatter, bar, histograms, heatmaps and 3D figures, exported to PNG, PDF or SVG.

- skill · `type=skill` · Claude Code · 257 installs
- Author: davila7
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/scientific/matplotlib
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/matplotlib

## What it does

The skill teaches the agent how to use matplotlib: the pyplot interface in MATLAB style and the object-oriented Figure/Axes API, the object hierarchy, plot types and saving figures. It ships code samples for line plots, scatter, bar charts, histograms, heatmaps, contours, box and violin plots, plus 3D through `mpl_toolkits.mplot3d`.

Multi-panel layouts get their own section: a plain `plt.subplots` grid, `subplot_mosaic` and `GridSpec` when you need full control. Styling covers named colors, hex codes, RGB tuples, colormaps such as `viridis` and `coolwarm`, style sheets and `rcParams` tweaks. Export goes through `plt.savefig` with `dpi`, `bbox_inches='tight'` and `transparent`.

The examples assume Python with matplotlib and numpy installed, so drop the skill into a project that already has both. For publication figures the guidance points to `dpi=300`, for web output 150. If your charts come from a different library, the extra hints just add noise for the agent.

## Install

### Claude Code (native platform)

1. **claude-code-templates**
```bash
npx claude-code-templates@latest --skill scientific/matplotlib
```

2. **Skills CLI (Vercel)**
```bash
npx skills add davila7/claude-code-templates --skill matplotlib -a claude-code
```

3. **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

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

### Cursor

**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 davila7/claude-code-templates matplotlib
```

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

### Gemini CLI

**Platform CLI**
```bash
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/scientific/matplotlib
```

### Windsurf (Devin Desktop)

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

### 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/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/scientific/matplotlib

## When to use it
- plot a time series with labeled axes
- build a four-panel grid mixing plot types
- render a correlation matrix as a heatmap with a colorbar
- export a figure to PDF for a paper
- draw a 3D surface from X, Y, Z arrays

## Example prompts
- plot sin(x) and cos(x) on one Axes with a legend and grid
- make a 2x2 figure with line, scatter, bar and histogram, save it as PNG at dpi=300
- draw a heatmap of the matrix with imshow, colormap coolwarm, and add a colorbar

## Similar
- [matplotlib-best-practices](https://affpapa.org/en/nevibecode/skills/matplotlib-best-practices.md) — skill · 1000 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-analysis-jupyter](https://affpapa.org/en/nevibecode/skills/data-analysis-jupyter.md) — skill · 1500 installs
- [scientific-visualization](https://affpapa.org/en/nevibecode/skills/k-dense-ai-scientific-visualization.md) — skill · 2400 installs
- [seaborn](https://affpapa.org/en/nevibecode/skills/k-dense-ai-seaborn.md) — skill · 2100 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 · tondevrel](https://affpapa.org/en/nevibecode/skills/tondevrel-matplotlib.md) — 374 installs

From the same set: [davila7/claude-code-templates](https://affpapa.org/en/nevibecode/by/davila7/claude-code-templates.md) — 205 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
