# figure-generation

Builds publication-ready scientific plots through query expansion, code execution, and visual verification. Helps researchers format charts for papers.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 2300 installs · ★ 433
- Author: lingzhi227
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/lingzhi227/agent-research-skills/tree/HEAD/skills/figure-generation/SKILL.md
- Updated: 2026-02-27
- HTML: https://affpapa.org/en/nevibecode/skills/figure-generation

## What it does

The skill generates academic figures using `matplotlib` and `seaborn` across three stages. It turns a prompt into detailed specifications, writes a Python script, and runs it locally. If execution throws an error or fails to produce an image, the agent catches the traceback and retries up to 4 times.

Every run exports both a 300 DPI PNG preview and a vector PDF for final document assembly. The tool also prints a ready-to-use `\begin{figure}` LaTeX snippet. Pre-built templates from `scripts/figure_template.py` include formats such as heatmaps, radar plots, ablation graphs, and training curves.

A working Python environment is strictly required on your machine. The skill enforces paper publication standards automatically: labels remain at 8pt or larger, palettes avoid red-green confusion, and standard matplotlib titles are swapped for LaTeX captions.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add lingzhi227/agent-research-skills --skill figure-generation -a claude-code
```

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

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add lingzhi227/agent-research-skills --skill figure-generation -a codex
```

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

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add lingzhi227/agent-research-skills --skill figure-generation -a cursor
```

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

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install lingzhi227/agent-research-skills figure-generation
```

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

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add lingzhi227/agent-research-skills --skill figure-generation -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/lingzhi227/agent-research-skills --path skills/figure-generation
```

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add lingzhi227/agent-research-skills --skill figure-generation -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/lingzhi227/agent-research-skills/tree/HEAD/skills/figure-generation/SKILL.md

## When to use it
- create vector PDF plots matching academic paper standards
- fix matplotlib script execution errors within 4 retries
- generate accessible figures using colorblind-safe palettes
- produce LaTeX figure snippets alongside rendered charts

## Example prompts
- Generate an ablation plot using results from results/ablation.csv
- Create a training curve in vector PDF format for a conference paper
- Plot an attention heatmap from attention_weights.npy with colorblind-friendly colors

## Similar
- [mathmodel-figure-templates](https://affpapa.org/en/nevibecode/skills/mathmodel-figure-templates.md) — skill · 1700 installs
- [figure-designer](https://affpapa.org/en/nevibecode/skills/figure-designer.md) — skill · 739 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
- [data-analysis-jupyter](https://affpapa.org/en/nevibecode/skills/data-analysis-jupyter.md) — skill · 1500 installs
- [create-viz](https://affpapa.org/en/nevibecode/skills/create-viz.md) — skill · 5200 installs

From the same set: [lingzhi227/agent-research-skills](https://affpapa.org/en/nevibecode/by/lingzhi227/agent-research-skills.md) — 30 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
