plotting-agent
Step 2 of the PaperOrchestra pipeline (arXiv:2604.05018). Execute the visualization plan from outline.json — render plots and conceptual diagrams from…
by Chen-Jin-Han★ 24 GitHub stars
Install plotting-agent in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
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 theplotting_planarrayworkspace/inputs/idea.mdandworkspace/inputs/experimental_log.md— the source dataworkspace/inputs/figures/— optional pre-existing figures (PlotOnmode)
Outputs
workspace/figures/<figure_id>.png— one PNG perplotting_planentry (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)
Read the figure spec from
outline.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" }Few-shot retrieval (visual planning): pick the matching pattern from
references/chart-patterns.md(forplot_type=="plot") orreferences/diagram-patterns.md(forplot_type=="diagram").Extract data: parse
idea.mdand/orexperimental_log.md(data_sourcefield tells you which) to obtain the numeric values or conceptual entities the figure needs. Forexperimental_log.md, the## 2. Raw Numeric Datasection contains markdown tables.Render:
If
PAPERBANANA_PATHis set — use the PaperBanana backbone (Zhu et al., 2026). It runs a Retriever → Planner → Stylist → Visualizer → Critic loop and is especially good forplot_type == "diagram". Seereferences/paperbanana-cookbook.mdfor setup (needs a Gemini API key).python skills/plotting-agent/scripts/paperbanana_render.py \ --figure-id <figure_id> \ --caption "<objective from figure spec>" \ --content-file workspace/inputs/idea.md \ --task <diagram|plot> \ --aspect-ratio <aspect_ratio> \ --out workspace/figures/<figure_id>.pngOtherwise — write a matplotlib script and run it via your Bash tool, or use the bundled helper:
python skills/plotting-agent/scripts/render_matplotlib.py \ --spec spec.json \ --out workspace/figures/<figure_id>.pngThe script must apply the academic style from
chart-patterns.md, use the correct pixel size fromaspect-ratios.md, save at 300 DPI, and callplt.close()aftersavefig.VLM critique loop (optional, only if your host has vision):
- Reload the rendered PNG as a multimodal input to your LLM.
- Critique it against the figure's
objectivefrom the outline. Look for: visual artifacts, mislabeled axes, illegible text, color clashes, misleading scaling, missing legend, overlapping labels. - If problems are found, regenerate the matplotlib script with corrections and re-render. Cap at 3 critique iterations per figure.
- This is the closed-loop refinement step the paper inherits from
PaperBanana. See
references/plotting-pipeline.mdfor the full loop description. - If your host has no vision input, skip this step entirely. The figure will still render correctly, just without iterative refinement.
Generate the caption using the verbatim Caption Generation prompt at
references/caption-prompt.md. Inputs to the caption prompt:task_name— the section the figure belongs to (e.g., "Methodology", "Experiments")raw_content— the surrounding section text (or content_bullets from the section_plan if the section isn't drafted yet)description— theobjectivefield from the figure specfigure_desc— a 1-sentence description of what the rendered figure actually shows (from your VLM critique pass, or from the script's plan if no vision)
Write the caption to
workspace/figures/captions.jsonkeyed byfigure_id. Captions must NOT containFigure N:orCaption N:prefixes — the LaTeX template handles numbering. Plain text only, no markdown.
Conceptual diagrams
For plot_type == "diagram", prefer PaperBanana when available — its
Retriever grounds the Planner in real published paper diagrams. If
PAPERBANANA_PATH is unset, follow references/diagram-patterns.md.
Patterns include block diagrams, system overviews, flowcharts, and
algorithm-as-graph. The bundled helper:
python skills/plotting-agent/scripts/render_diagram.
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
- references/aspect-ratios.md
- references/caption-prompt.md
- references/chart-patterns.md
- references/diagram-patterns.md
- references/paperbanana-cookbook.md
- references/plotting-pipeline.md
- scripts/paperbanana_render.py
- scripts/render_diagram.py
- scripts/render_matplotlib.py
FAQ
What does the plotting-agent skill do?
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".
How do I install the plotting-agent skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the plotting-agent skill run scripts?
Yes, this skill bundles executable scripts. Review the source before installing.
Related skills
agent-skill-stack
GitHubFind, evaluate, and assemble the smallest compatible set of AI Agent Skills for an end-to-end natural-language goal. Use when a user wants Skills for a…
build-evidence-map
GitHubBuild an auditable evidence map for a contested technical choice, research synthesis, proposal review, or consequential decision. Use when Copilot must…
pinecone-rag
GitHubBuild production RAG pipelines and persistent agent memory using Pinecone as the vector database backend. ALWAYS USE THIS SKILL when the user mentions…
qdrant-monitoring-debugging
GitHubDiagnoses Qdrant production issues using metrics and observability tools. Use when someone reports 'optimizer stuck', 'indexing too slow', 'memory too high'…