Sandbox
@VILA-Lab/FigMirror

FigMirror skill for Claude Code and Codex

FigMirror turns a reference paper figure and your data into an editable matplotlib script plus a camera-ready PDF. It works through a Drawer/Reviewer loop, with separate agents for drawing and visual review, and a local web UI for upload, iteration browsing, and refinement.

510 stars38 forksPythonUpdated 15d ago
Who it's for

Builders who want their agent to reproduce a paper figure's style from a screenshot and their own data.

What it delivers

You can generate a figure that matches a paper's style without manually reworking plots by hand.

What it does

Reference-conditioned figure generation

Takes a reference figure as the style target and your data as input, then produces an editable matplotlib script and PDF.

Drawer and Reviewer agents

Uses separate `figmirror-drawer` and `figmirror-reviewer` agents to draw a candidate figure and critique it with structured feedback.

Grounded measurement loop

Turns visual targets into measurable checks so the reviewer can point to regions, compare details, and guide the next revision.

Local web UI

Provides upload, preview, iteration history, and refinement in a browser through `scripts/figcopy_serve.py`.

Claude Code and Codex skill install

Installs the FigMirror skill into Claude Code or Codex through the bundled shell installer.

3D figure support

Adds geometry-aware prompting and repair checks for 3D plots so the loop preserves camera, scale, lighting, and composition.

How to get it

  1. 1Already inside Claude Code or Codex? Paste this and let the agent do the setup
    Install FigMirror for me: https://github.com/VILA-Lab/FigMirror
  2. 2If uv is missing: python3 -m pip install uv.
    git clone https://github.com/VILA-Lab/FigMirror.git && cd FigMirror
    bash scripts/install.sh
    uv run python scripts/figcopy_serve.py --workspace .artifacts/figmirror-workspace --backend codex
  3. 3Use this when you want FigMirror inside your agent, no web UI. The bundled Python…
    curl -fsSL https://raw.githubusercontent.com/VILA-Lab/FigMirror/main/scripts/install.sh | bash
  4. 4Target one runtime explicitly
    curl -fsSL https://raw.githubusercontent.com/VILA-Lab/FigMirror/main/scripts/install.sh | bash -s -- --codex
    curl -fsSL https://raw.githubusercontent.com/VILA-Lab/FigMirror/main/scripts/install.sh | bash -s -- --claude
    curl -fsSL https://raw.githubusercontent.com/VILA-Lab/FigMirror/main/scripts/install.sh | bash -s -- --all
  5. 5Then attach a paper-figure screenshot, paste your data, and ask
    Use FigMirror to mirror this figure's style with my data.

README

FigMirror

FigMirror: Plot Your Data in Any Paper's Style.
Pick a reference figure, paste your data, and get an editable matplotlib script plus a camera-ready PDF.

FigMirror turns repeated plotting-code edits into a polished paper figure

Web UI Codex skill Claude Code skill arXiv paper FigMirror gallery Contributions welcome

Paper & Results | Showcase | Milestones | Quick Start | How It Works | Star History | Method | Contribute

English | 中文

🔥 Milestones

  • Jun 1, 2026 — FigMirror release: shipped FigMirror as Claude Code and Codex skills, with a local Web UI for upload, iteration browsing, and refinement.
  • Jun 17, 2026 — Algorithm update: refined the Codex path with role-separated Drawer / Reviewer agents, far-near visual review views, reviewer bounding boxes, and annotated feedback passed into the next iteration.
  • Jul 1, 2026 — Evaluation update: built an internal hybrid style scorer for repeatable method comparison.
  • Aug 17, 2026 — Claude Code parity: ported the production role-separated loop to Claude Code with the same decision state machine and bounded iteration contract.
  • Aug 28, 2026 — arXiv preprint: released FigMirror: Ground It, Code It, Plot It, introducing PlotTwin-Bench and the paper's benchmark results.

📝 Paper & Results

Our arXiv preprint, FigMirror: Ground It, Code It, Plot It (August 28, 2026), introduces PlotTwin-Bench for reference-conditioned scientific-figure style transfer.

The paper reports a 150-instance evaluation subset: all 50 hand-curated references and 100 randomly sampled augmented references. FigMirror achieves the highest combined score on both splits: 72.7 on hand-curated references and 76.4 on augmented references. The splits are reported separately, and all methods in this comparison use GPT-5.5.

Paper Table 1 showing PlotTwin-Bench code, vision, and combined scores for FigMirror and four baselines

Main results. PlotTwin-Bench comparison by code, vision, and combined scores. FigMirror achieves the highest combined score on both the hand-curated and augmented reference splits.

Qualitative style-transfer comparison of FigMirror, Plot2Code, METAL, ChartGalaxy, and ChartIR on two references

Qualitative comparison. Each group shows the reference, FigMirror, and four baselines on the same target data. Group A tests a dense multi-panel composition; Group B tests a joint hexbin plot with marginal histograms.

Showcase

FigMirror uses a reference figure as the style target, then renders your data through an iterative Drawer / Reviewer loop until the output looks like it belongs in the same paper family.

ReferenceFigMirror Output
reference paper-style figureFigMirror generated paper-style output
ReferenceFigMirror OutputReferenceFigMirror Output
reference joint hexbin plotFigMirror generated joint hexbin outputreference 3D waterfall plotFigMirror generated 3D waterfall output

Browse the FigMirror gallery
No high-quality reference at hand? Start from 139 paper figures across 25 chart families.

Quick Start

Install With Your Claude / Codex

Already inside Claude Code or Codex? Paste this and let the agent do the setup:

Install FigMirror for me: https://github.com/VILA-Lab/FigMirror

Web UI

Use this when you want upload, preview, iteration history, and refinement in a browser.

If uv is missing: python3 -m pip install uv.

git clone https://github.com/VILA-Lab/FigMirror.git && cd FigMirror
bash scripts/install.sh
uv run python scripts/figcopy_serve.py --workspace .artifacts/figmirror-workspace --backend codex

Use --backend claude to run the same Web UI through Claude Code.

Open http://127.0.0.1:8765/.

The installer auto-detects Claude Code and Codex. For either harness, it installs the figmirror skill plus the figmirror-drawer and figmirror-reviewer custom agents used by the current role-separated algorithm.

Skill Only

Use this when you want FigMirror inside your agent, no web UI. The bundled Python helpers use uv; install it first with python3 -m pip install uv if it is not already available. On shared or small-root machines, run df -h and export UV_CACHE_DIR to a user-owned directory on the largest non-root writable filesystem before the first invocation.

curl -fsSL https://raw.githubusercontent.com/VILA-Lab/FigMirror/main/scripts/install.sh | bash

Target one runtime explicitly:

curl -fsSL https://raw.githubusercontent.com/VILA-Lab/FigMirror/main/scripts/install.sh | bash -s -- --codex
curl -fsSL https://raw.githubusercontent.com/VILA-Lab/FigMirror/main/scripts/install.sh | bash -s -- --claude
curl -fsSL https://raw.githubusercontent.com/VILA-Lab/FigMirror/main/scripts/install.sh | bash -s -- --all

Then attach a paper-figure screenshot, paste your data, and ask:

Use FigMirror to mirror this figure's style with my data.

Need manual target selection, Claude backend, or troubleshooting? See Detailed Install.

How It Works

FigMirror architecture loop and grounded measurement algorithm

Illustration of FigMirror. The left panel shows the core agentic loop; the right panel introduces Grounded Measurement.

FigMirror uses an agentic Drawer-Reviewer loop. In both Codex and Claude Code, a top-level Orchestrator delegates drawing to the named figmirror-drawer agent and visual audit to the named figmirror-reviewer agent. The Reviewer sees a far-view composite plus full-resolution source and candidate views, returns structured feedback with bounding boxes, and the Orchestrator turns that feedback into an annotated image and notes for the next Drawer pass. The two harnesses share the same decision state machine and hard iteration cap; only their subagent transport differs.

The Drawer renders a candidate figure with Grounded Measurement. The Reviewer compares it with the reference image, then returns a visual review, a revision checklist, and a preserve list. The preserve list accumulates across iterations as an anchor against style drift. The Aesthetic Lib provides fallback principles, style rules, and figure properties when the agents disagree or the Drawer has low confidence.

For 3D figures, FigMirror adds geometry-aware prompting for camera, scale, surfaces, lighting, and repair checks, helping the loop preserve the 3D composition of the reference figure while producing editable matplotlib code.

Grounded Measurement builds on two properties of computer-use-trained foundation models: Measurement with Axis, which lets the model return x/y coordinates for visual targets; and Resonate with Code, which turns those coordinates into executable checks, such as cropping a line segment and reading its color from pixels.

For the detailed algorithm, architecture, product envelope, and spec map, read docs/method.md. For the web UI, see scripts/README_figcopy_serve.md.

Contributing

FigMirror welcomes contributions!

Open an issue for bugs, broken installs, or figure cases FigMirror should learn from; open a PR for showcase examples, prompt improvements, UI polish, or small regression tests.

  • Showcase cases: add reference/output pairs that prove the method across chart families.
  • UI polish: make the web workflow feel instant, legible, and forgiving.
  • Prompt and reviewer quality: improve the Drawer / Reviewer loop without weakening the grounding rules.
  • Evaluation: add reproducible cases that catch visual drift, floor violations, and broken exports.

Start with docs/contributing.md. Good first PRs include adding a showcase example, improving a web UI interaction, tightening install docs, or adding a small regression test around runner behavior.

Star History

FigMirror GitHub star history chart

Rendered by Star History from GitHub stargazer data, so the chart stays current as the repository grows.

Roadmap

  • Ship the reference-to-figure loop as Codex and Claude Code skills.
  • Add a local Web UI for upload, iteration browsing, and refinement.
  • Publish a 139-figure gallery so users can start without hunting for references.
  • Refine the Codex algorithm with role-separated Drawer / Reviewer agents and bbox-annotated visual feedback.
  • Build an internal hybrid style scorer for repeatable method comparison.
  • Release the scorer protocol, benchmark design, baselines, and analysis in an arXiv paper.
  • Release reproducible PlotTwin-Bench artifacts with references, target data, generated outputs, and evaluation metadata.
  • Harden install and runtime docs for more OpenAI-compatible and local-agent backends.

📚 Citation

If FigMirror helps your work, please cite:

@misc{zhao2026figmirrorgrounditcode,
      title={FigMirror: Ground It, Code It, Plot It},
      author={Xiaohan Zhao and Jiacheng Liu and Yaxin Luo and Zhiqiang Shen},
      year={2026},
      eprint={2608.28814},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2608.28814},
}

Files in the repo

Repository payload13 top-level entries
  • .claude
  • .codex
  • docs
  • openspec
  • resources
  • scripts
  • spike-results
  • tests
  • .gitignore
  • pyproject.toml
  • README.md
  • README.zh-CN.md
  • uv.lock

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More skills

obra/
superpowers

An agentic skills framework & software development methodology that works.

285k
1 add

Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local deterministic AST parsing, every edge explained, no vector store.

117k
1 add
Vincentwei1021/
anything2explainer

Topic in, narrated explainer video out. A Claude Code / Codex skill that turns any topic into a black-canvas motion-graphics explainer video with TTS voiceover, subtitles and a chapter progress bar. Chinese or English; every frame drawn in code with Remotion.

666

Open-source AI job search: scan job portals, evaluate listings into a structured A-H report with a global 1-5 score, tailor your CV, track applications — runs locally in your AI coding CLI (Claude Code, Codex, OpenCode, Antigravity…)

71k