Skip to content

Note open source

All posts
Oct 27, 20268 min readopen source · AI agent · data visualization · matplotlib · research toolsRead in:ENID

FigMirror: Plot Your Data in Any Paper's Figure Style

FigMirror is an open source AI agent from VILA Lab that clones the style of any academic figure and redraws your data in it, using a Drawer and Reviewer loop with Grounded Measurement, backed by 548 GitHub stars.

Colorful line graphs on a dark grid, like a research figure.

Every researcher knows the feeling. You find a figure in a paper that looks exactly right: the colors, the typography, the panel layout. Then you spend an afternoon trying to recreate that look with your own data, tweaking font sizes and hex codes until the plot stops looking like a rough draft. FigMirror automates that job. Give it a reference figure and your data, and it redraws your data in the reference's style, as editable matplotlib code with a camera-ready PDF at the end.

The project is VILA-Lab/FigMirror, described on GitHub as an automated AI agent tool for plotting your data in any paper's figure style. At the time of writing it holds 548 stars and 40 forks, and it comes from VILA Lab at MBZUAI. Watch the 30-second repo signal: Clone Any Academic Figure with AI.

Key Takeaways

FigMirror takes a reference figure plus your data and produces a new figure in the reference's visual style, not a copy of the reference itself.

A Drawer agent draws, a Reviewer agent critiques, and the loop iterates until the output matches, with a preserve list that stops style drift.

Grounded Measurement is the core trick: the agent measures the reference by coordinates and turns those measurements into executable checks.

The output is editable matplotlib code plus a PDF, so you can fix anything by hand afterward.

It ships as Claude Code and Codex skills, with a local web UI for upload, preview, and iteration browsing.

The method is backed by an arXiv preprint and a 399-reference benchmark, PlotTwin-Bench.

The Problem FigMirror Solves

Reproducing a figure and restyling your own data are two different tasks, and most tools only do the first. Converting a published figure into code is a neat demo, but it is not what a researcher usually needs. What you need is your new results presented with the visual language of a figure you admire: its color scheme, its typography, its panel arrangement, its axis styling.

That transfer is hard because style lives in details. A color is not just "blue", it is a specific hex value read off a specific line segment. A font is not just "serif", it is a size, a weight, and a placement relative to an axis. Pixel-level imitation guesses at these details and drifts. FigMirror's answer is to measure them instead of guessing.

The project is built for that exact setting, which its paper calls reference-conditioned style transfer: plot new data while preserving the visual style of a reference figure. If you want the broader picture of what open source means for a project like this, the earlier explainer What Is Open Source? covers the basics.

How It Works: The Drawer and the Reviewer

FigMirror runs an agentic loop with two roles. The Drawer renders a candidate figure. The Reviewer compares it with the reference image and returns a visual review, a revision checklist, and a preserve list. The Orchestrator turns that feedback into an annotated image and notes for the next Drawer pass, and the cycle repeats under a hard iteration cap.

Two details make this loop work better than a single "draw me a figure" prompt.

First, the preserve list. It accumulates across iterations as an anchor against style drift, recording the elements that are already right so later revisions do not break them while fixing something else. Anyone who has watched an iterative AI tool fix one problem and introduce two more will recognize why this matters.

Second, Grounded Measurement. The Drawer does not eyeball the reference. It builds on two capabilities of computer-use-trained foundation models: Measurement with Axis, which returns x and 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. The style is measured, then coded, then checked against the measurement.

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

What You Actually Get

The output is not a PNG you have to accept or reject. It is an editable matplotlib script plus a camera-ready PDF. That distinction is the whole point for publication work: you can open the script, adjust a label, move a legend, change a color, and regenerate. The agent does the tedious first 90 percent, and you keep final control.

The project also ships a gallery to start from. If you have no high-quality reference at hand, you can pick from 139 paper figures across 25 chart families, and the showcase covers dense multi-panel compositions, joint hexbin plots with marginal histograms, and 3D waterfall plots.

The Research Behind It

FigMirror is not just a tool with a catchy demo. It comes with a paper, FigMirror: Ground It, Code It, Plot It, by Xiaohan Zhao, Jiacheng Liu, Yaxin Luo, and Zhiqiang Shen of VILA Lab, submitted to arXiv on August 28, 2026. The paper introduces PlotTwin-Bench, an expert-curated benchmark for reference-conditioned style transfer with fine-grained code and image-level style metrics.

On the paper's 150-instance evaluation subset, 50 hand-curated references plus 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, with all compared methods using GPT-5.5. The full benchmark holds 399 references, and the default bench config on the Hugging Face Hub holds the 150 evaluation tasks.

Benchmark numbers deserve a caveat, and this one is no exception. A combined style score is a proxy for "looks like the reference", not a guarantee that your specific figure will come out perfect. The honest reading is that the method beats its baselines on a curated test, and the editable output means you can see and fix the rest.

Getting Started

FigMirror installs as a skill inside Claude Code or Codex, or runs through a local web UI. The skill-only path is one command:

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

  2. Attach a paper-figure screenshot, paste your data, and ask: "Use FigMirror to mirror this figure's style with my data."

For the web UI, which adds upload, preview, iteration history, and refinement in a browser:

  1. Clone the repository: `git clone https://github.com/VILA-Lab/FigMirror.git && cd FigMirror`

  2. Run the installer: `bash scripts/install.sh`

  3. Start the server: `uv run python scripts/figcopy_serve.py --workspace .artifacts/figmirror-workspace --backend codex`

  4. Open `http://127.0.0.1:8765/`

Use `--backend claude` to run the same web UI through Claude Code. The installer auto-detects your agent harness and installs the `figmirror` skill plus the `figmirror-drawer` and `figmirror-reviewer` custom agents used by the role-separated loop.

The Honest Limits

FigMirror clones style, not meaning, and that boundary matters. It can faithfully reproduce a reference's look while your data tells a different story than the reference did, so you still need to check that the new figure is honest: axes labeled correctly, scales not misleading, and no visual element carried over from the reference that implies something your data does not support.

It is also an agent loop with a model behind it, so each iteration costs tokens, and the hard iteration cap exists for a reason. Start with a clean reference and well-formatted data, and expect to spend your effort on the final polish pass in the matplotlib code, which is exactly where a researcher should be spending it.

Finally, a style note for academic use. Borrowing a figure's style is normal practice in scientific publishing, but copying a figure's content is not. FigMirror is built for the first case: your data, their look. Keep that line clear in your own work.

Who Should Try It?

FigMirror fits researchers and students preparing paper figures, posters, or slides who want a professional look without a day of matplotlib fiddling. It fits anyone who has a favorite figure style from their field and a new dataset that deserves the same treatment. And it fits AI agent builders curious about a genuinely clever loop: measuring a picture with coordinates, turning measurements into code, and checking the code against the picture.

It is less useful if you just need a quick default chart, where a plain matplotlib or seaborn plot is faster, or if your figure has no reference style to borrow at all. The tool's value is in the transfer, not in drawing from scratch.

Frequently Asked Questions

What is FigMirror?

FigMirror is an open source AI agent tool that plots your data in the visual style of any reference paper figure, producing editable matplotlib code and a camera-ready PDF.

How is it different from asking a chatbot to draw a chart?

A chatbot guesses at style from a description. FigMirror measures the reference figure by coordinates, turns those measurements into executable checks, and iterates with a Drawer and Reviewer loop until the output matches, with a preserve list that stops later revisions from breaking earlier wins.

What do I get at the end?

An editable matplotlib script plus a PDF. You can open the script and adjust labels, colors, and layout by hand.

Do I need Claude Code or Codex?

FigMirror ships as skills for both, plus a local web UI that runs through either backend. Pick the harness you already use.

Is there a benchmark?

Yes. PlotTwin-Bench, introduced in the FigMirror preprint, holds 399 references, with a 150-task evaluation subset on which FigMirror scores 72.7 on hand-curated references and 76.4 on augmented references.

Can it handle 3D figures?

Yes, with geometry-aware prompting for camera, scale, surfaces, and lighting, plus repair checks to preserve the 3D composition.

The Bottom Line

Most chart tools ask you to describe the figure you want. FigMirror asks you to show it one. Measure the style, code the style, check the code against the measurement, and hand the researcher an editable script at the end. For anyone who has ever lost an afternoon to font sizes and hex codes, that is a very good trade.

Read this article in Indonesian: FigMirror: Plot Data Anda dengan Gaya Figure Paper Apa Pun.

Tags: open source · AI agent · data visualization · matplotlib · research tools

All posts