TL;DR
FigMirror is an agentic framework designed to automatically transfer the visual style (like typography, color schemes, and layout spacing) of a reference scientific figure onto new datasets. By repurposing the coordinate-grounding capabilities of modern computer-use models into a technique called "Grounded Measurement," it extracts exact style attributes via executable code and refines them through an iterative Drawer-Reviewer loop.
What Problem Does This Paper Address?
Creating publication-quality scientific figures is notoriously tedious. Researchers often spend hours manually tweaking fonts, padding, and color cycles to make their charts look polished. While recent AI models can translate a chart image back into executable code (chart-to-code), they focus strictly on reproducing the exact same chart.
If you want to adopt the beautiful aesthetic of a top-tier journal figure but plot your own data, existing methods fall short. They try to optimize at the holistic pixel level or estimate attributes "by eye," which hopelessly entangles the reference figure's data with its visual style. Disentangling data from style requires precisely identifying and measuring individual visual attributes—a task current plotting models aren't built to do.
Methods
The authors introduce Grounded Measurement, driven by a key insight: scientific plots share a core anatomy with Graphical User Interfaces (GUIs). Both are code-rendered structures composed of discrete elements with sharp boundaries, flat fills, and text labels.
Instead of training a model from scratch, FigMirror repurposes the coordinate-grounding skills of modern computer-use agents (models trained to operate software by clicking UI elements). The framework operates via a multi-turn Drawer-Reviewer loop:
- The Drawer & Grounded Measurement: The Drawer initializes a "Style Checklist." For each open attribute (e.g., bar color), it predicts the bounding box coordinates of that element on the reference figure. It then writes and executes a tiny Python script to measure the exact value from those pixels (e.g., calculating the mean RGB value of the cropped region). Once measured, it applies these styles to the user's new data template.
- The Reviewer: A Vision-Language Model (VLM) visually audits the generated draft against the reference. Crucially, it provides grounded feedback by drawing bounding boxes around visual defects (like overlapping text or clipped labels) rather than giving vague text critiques.
The loop repeats, updating a "Preserve List" and a "Revision List" until all style discrepancies are resolved.
Datasets
Because no existing benchmark evaluates figure style transfer, the authors introduced PlotTwin-Bench. It consists of 400 reference figures spanning 12 distinct chart types (including grouped bars, heatmaps, and multi-panel line plots), paired with newly synthesized, structurally compatible datasets.
The benchmark draws from two sources:
- Hand-curated (50 figures): Complex, high-quality figures manually extracted from top-tier papers and replotted by hand to ensure clean, aligned ground-truth code.
- Augmented (350 figures): Existing charts from the ChartMimic dataset, enriched via an LLM rewriting pipeline to introduce higher structural complexity and visual polish.
Key Insights and Ideas
- Plots as Interfaces: Treating a scientific plot like a GUI unlocks the latent spatial-grounding capabilities of computer-use models, turning a vague visual task into a precise coordinate-and-code problem.
- Disentanglement via Code Execution: Eyeballing a color or line width introduces drift. Executing programmatic checks on local image crops guarantees exact attribute extraction (e.g., finding the exact hex code).
- Targeted Local Repairs: Providing localized bounding boxes in the review stage (e.g., "Title too small, see Box 1") prevents the Drawer from accidentally altering attributes it already got right during subsequent iterations.
Key Results
Evaluated on PlotTwin-Bench using GPT-5.5, FigMirror consistently outperformed state-of-the-art chart-to-code baselines (including ChartIR, ChartGalaxy, Plot2Code, and METAL) across both code-level and vision-level metrics.
- Hand-Curated Split: On the challenging real-paper dataset, FigMirror achieved a combined score of 72.7, outperforming the strongest baseline (ChartIR) by 11.4 points. It led by 5.8 points in exact code attribute matching and 13.3 points in visual fidelity.
- Ablation Studies: Removing the Reviewer dropped the overall score by 2.1 points. More drastically, removing Grounded Measurement (forcing the model to estimate styles by eye) caused a 7.2-point drop in the vision score due to severe visual drift.
- Iteration Benefits: Increasing the maximum allowed loop iterations from 1 to 5 steadily boosted the combined score from 71.8 to 74.3, demonstrating the effectiveness of the iterative refinement process.
Limitations and Future Work
FigMirror operates as a model-side harness, meaning its performance is fundamentally capped by the capabilities of its underlying multimodal LLM. If the model mislocalizes an element or fails to spot a visual overlap during the review phase, errors can bypass the loop uncorrected.
Additionally, the authors note that if future frontier models become capable of perfectly inferring, measuring, and coding complex chart styles in a single shot, multi-turn agentic frameworks like FigMirror may eventually become redundant.
Summary updated