# Plotting Agent

Step 2 of the PaperOrchestra pipeline (arXiv:2604.05018).

- Repository: https://github.com/Ar9av/PaperOrchestra (694 stars)
- Category: AI and agents
- License: see repository
- Last updated: 2026-10-11
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add Ar9av/PaperOrchestra --skill plotting-agent -g -a claude-code -y`
Codex: `npx skills add Ar9av/PaperOrchestra --skill plotting-agent -g -a codex -y`
Cursor: `npx skills add Ar9av/PaperOrchestra --skill plotting-agent -g -a cursor -y`
Gemini CLI: `npx skills add Ar9av/PaperOrchestra --skill plotting-agent -g -a gemini-cli -y`

## Description

Step 2 of the PaperOrchestra pipeline (arXiv:2604.05018). Execute the visualization plan from outline.json, render plots and conceptual diagrams from experimental_log.md and idea.md, optionally refine via VLM critique loop, and produce context-aware captions. Runs in parallel with the literature-review-agent. TRIGGER when the orchestrator delegates Step 2 or when the user asks to "generate the figures for my paper" or "render the plots from this experiment log".

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Plotting Agent (Step 2)

Faithful implementation of the Plotting Agent from PaperOrchestra
(Song et al., 2026, arXiv:2604.05018, §4 Step 2 and App. F.1 p.45).

**Cost: ~20, 30 LLM calls.** The paper uses PaperBanana (Zhu et al., 2026) as
the default backbone with a closed-loop VLM-critique refinement. This skill
expresses that loop in host-agent terms: you (the host agent) generate
matplotlib code with your own LLM, render via your Bash/Python tool,
optionally critique the rendered PNG with your vision model, redraw, and
finally caption.

## Inputs

- `workspace/outline.json`, specifically the `plotting_plan` array
- `workspace/inputs/idea.md` and `workspace/inputs/experimental_log.md`, the source data
- `workspace/inputs/figures/`, optional pre-existing figures (`PlotOn` mode)

## Outputs

- `workspace/figures/<figure_id>.png`, one PNG per `plotting_plan` entry
  (300 DPI, sized to the requested aspect ratio)
- `workspace/figures/captions.json`, `{figure_id: caption_text}` map

## Workflow

### Per figure (executed independently per `figure_id`)

1. **Read the figure spec** from `outline.json`:
   ```json
   {
     "figure_id": "fig_main_results",
     "title": "Main Results on Dataset X",
     "plot_type": "plot",
     "data_source": "experimental_log.md",
     "objective": "Visual summary (Grouped Bar Chart) demonstrating ...",
     "aspect_ratio": "5:4"
   }
   ```

2. **Few-shot retrieval (visual planning)**: pick the matching pattern from
   `references/chart-patterns.md` (for `plot_type=="plot"`) or
   `references/diagram-patterns.md` (for `plot_type=="diagram"`).

3. **Extract data**: parse `idea.md` and/or `experimental_log.md`
   (`data_source` field tells you which) to obtain the numeric values or
   conceptual entities the figure needs. For `experimental_log.md`, the
   `## 2. Raw Numeric Data` section contains markdown tables.

4. **Render**:

The rest: https://github.com/Ar9av/PaperOrchestra/blob/HEAD/skills/plotting-agent/SKILL.md
