arXiv:2608.28814cs.CVAug 2026

Manuscript Offprint

arXiv:2608.28814

FigMirror: Ground It, Code It, Plot It

Xiaohan Zhao, Jiacheng Liu, Yaxin Luo, Zhiqiang Shen

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Converting scientific figures into executable code has gained increasing attention, yet existing methods primarily focus on reproducing the reference figure itself. A more practical setting is to plot new data while preserving the visual style of a reference figure (e.g., color scheme and typography). Prior approaches mimic the reference through pixel-level optimization and struggle to carry its style to new data. We show that the key to this task lies in the coordinate grounding and coding capabilities present in modern computer-use models. We propose FigMirror, an agentic framework that unlocks these capabilities through Grounded Measurement, which locates visual elements by coordinates and measures their properties through executable code. We further introduce PlotTwin-Bench, an expert-curated benchmark with fine-grained code and image-level style metrics. Experiments show that FigMirror consistently outperforms existing methods on reference-conditioned style transfer. All plots in this paper are generated by FigMirror, except those produced by other methods for comparison. Our code and data are available at: https://github.com/VILA-Lab/FigMirror.

Figure

A Local atmospheric constraints

C 26 parameters : 12-scenario precision track : posterior/iracle shadows

B Population formation posterior

(a) Reference (de Blas et al., 2020, Fig. 1)

(b) Style transfer by FigMirror

Figure 1: Reference-conditioned style transfer. FigMirror preserves the visual style of a reference scientific figure while adapting it to new target data.

1 INTRODUCTION

Producing a publication-quality scientific figure is laborious and challenging. The spacing, panel sizes, and fonts often require multiple rounds of manual adjustment before the figure looks right (Rougier et al., 2014). Researchers have traditionally used well-crafted figures from top venues as references.

Figure

Figure 2: GUIs and scientific figures share localized, code-rendered elements with sharp boundaries, flat fills, and text. This structural similarity allows coordinate grounding learned for GUI elements to localize plot elements such as ticks, legends, and marks for measurement and review.

and manually adopted their spacing, colors, and layouts. Multimodal models can now interpret such references and generate the corresponding plotting code. However, most existing chart-to-code methods focus on reproducing the reference figure itself at the pixel level, rather than transferring its visual style and layout to new data.

Chart-to-code generation predates capable general-purpose large models, and early work fine-tuned specialized models for this task. Reproduction provides a natural training signal: the discrepancy between the rendered figure and the reference. ChartLlama (Han et al., 2023) is trained in this manner. General-purpose models have since made substantial progress in visual understanding and reasoning, yet the same recipe persists. METAL (Li et al., 2025a) adopts a multi-agent framework in which a generator writes the code and a critic repeatedly compares the rendered output against the reference and revises the code accordingly. This effectively moves the same optimization process to inference time. In either case, the objective remains reproduction. By contrast, transferring visual style of a reference figure to a researcher's own data has received little attention as a task in its own right.

A figure entangles its data with its style. We argue that transferring the style requires disentangling the two in two steps. The first is identification: locating the visual attributes that carry the transferable style, e.g., a color series or the spacing between subplots. The second, more critical, is measurement: computing each attribute's exact value, e.g., a hex code or a width in points, from the element's pixels. Modern general-purpose models have already learned the first step, just not from plotting. They are trained at scale for computer use (Anthropic, 2026; OpenAI, 2026; Bai et al., 2025; Wang et al., 2025). There, an agent operates software on behalf of a user, and every action begins with the coordinates of its on-screen target, a button or a menu entry. This demand instills coordinate grounding. A scientific plot, built from discrete, sharp-edged elements rendered by code (Figure 2), is as amenable to coordinate grounding, and as readily as a GUI. Yet existing plotting tasks do not explicitly invoke this skill or capability. When asked to match a reference figure, the model still tends to estimate visual attributes by eye.

To address this, we propose Grounded Measurement to redirect the skill from acting to measuring. The model grounds the element that carries a style attribute, and where a click would follow, a short program reads the exact value, a line's width or a series' color. One measurement, however, resolves one attribute. A transfer needs every attribute found, measured, applied, and re-checked on the rendered figure. Our proposed framework, FigMirror, organizes this work as a Drawer-Reviewer loop. The Drawer decomposes the reference into style attributes, measures each, and renders the user data into a candidate. The Reviewer checks the candidate against the reference visually. The two iterate until the candidate matches the reference style.

As no benchmark is dedicated to figure style transfer, we build PlotTwin-Bench. Its references come from two sources: figures replotted by hand from top venues and journals, and existing plotting code that a pipeline enriches into more complex and visually appealing figures. We extract scoring criteria from each reference and score candidates through two channels. The code channel runs an exact check on the attributes where the reference departs from a default plot. The vision channel catches problems that only appear once drawn, such as overlapping text or clipped labels.

Our contributions are:

  • We formulate reference-conditioned style transfer for scientific figures and identify precise style measurement as its core challenge.

  • We propose Grounded Measurement, which repurposes coordinate grounding to read each style attribute from the reference with code, and realize it in FigMirror, an agentic Drawer-Reviewer framework.

  • We build PlotTwin-Bench, the first benchmark designed for figure style transfer, with expert-curated figure-code pairs and per-reference scoring criteria that evaluate style from both code and rendered image. FigMirror consistently outperforms prior methods.