Overview and How It Works
FigMirror automates the creation of publication‑quality figures by replicating the style of a reference image with your own data. You provide a reference screenshot and your data (pasted or CSV); it returns an editable matplotlib script and a camera‑ready PDF.
Under the hood, an agentic Drawer‑Reviewer loop iteratively refines the output. The Drawer uses Grounded Measurement — reasoning with exact coordinates and pixel colours — to generate a candidate. The Reviewer compares it to the reference, issuing a visual review, a revision checklist, and a preserve list that accumulates across iterations to prevent style drift. An Aesthetic Library provides fallback principles when agents are uncertain. For 3‑D figures, geometry‑aware prompting maintains camera, scale, surfaces, and lighting.
The project also includes a Web UI and agent skills for Claude Code and OpenAI Codex.
Installation Prerequisites and Modes
Before installing, ensure you have Python 3, git, and uv (install with python3 -m pip install uv).
FigMirror offers two installation modes:
- Web UI – a browser‑based interface with upload, preview, and iteration history.
- Skill‑only – for use inside coding agents (Claude Code or Codex) without the web interface.
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
curl -fsSL https://raw.githubusercontent.com/VILA-Lab/FigMirror/main/scripts/install.sh | bash
Usage Workflows
If you lack a reference figure, start from the official gallery (139 paper figures across 25 chart families). This is the fastest way to evaluate the tool.
Web UI workflow:
1.
Launch the server with the command above.
2.
Open http://127.0.0.1:8765/.
3.
Upload a reference figure and provide your data.
4.
Watch the Drawer‑Reviewer loop run; preview iterations.
5.
Download the final matplotlib script and PDF.
Agent skill workflow:
1.
Attach a reference screenshot and your data.
2.
Prompt: Use FigMirror to mirror this figure's style with my data.
3.
The agent runs the loop and returns the script and rendered figure.
Configuration Options
The main configuration points are:
--workspace– path where intermediate artifacts and generated files are stored (e.g.,.artifacts/figmirror-workspace).--backend– LLM backend to use (codexor Claude).
No environment variables or configuration files are documented in the README.
Best Practices
- Choose the right mode: use the Web UI for an interactive, visual process; use the skill‑only install for a lighter, agent‑centric setup.
- Start from the gallery to quickly understand supported chart types and find high‑quality references.
- Contribute real‑world cases and prompt improvements, but avoid weakening the grounding rules of the Drawer/Reviewer loop.
Known Constraints
Style drift is a known risk; the preserve‑list mechanism is designed to counteract it.
Grounded Measurement relies on foundation models that can return coordinates and execute pixel checks, which may impose model capability requirements not detailed here.
For a full understanding of supported and unsupported use cases, consult docs/method.md.



