Agent2Figure: Evidence-Grounded Scientific Figure Generation via Geometry Compilation to Editable Vectors
Abstract
Automatically generating scientific method figures requires both content faithfulness and geometric correctness. Existing approaches fall into two families: one directly produces non-editable raster images, while the other generates vector code but asks the model to predict absolute coordinates, which is where layout errors originate and where they are hardest to repair automatically. We propose Agent2Figure, which reformulates method-figure generation as a compilation process that separates semantic decisions from geometric solving. A language model first produces FigureSpec, a typed, evidence-grounded intermediate representation that describes visual elements, semantic relations, grouping constraints, and their source text in the paper, but contains no coordinates. A deterministic geometry compiler then solves all element positions, connection anchors, and orthogonal paths, so that alignment, non-overlap, and port-to-port connection hold by construction for every object it constrains and every relation FigureSpec declares. A geometry checker and a vision-language reviewer diagnose residual issues, after which the system patches FigureSpec and recompiles rather than editing the final image. On PaperBananaBench (292 samples), Agent2Figure reaches an overall score of 63.9 against 57.4 for PaperBanana under the same judge, on a scale where the author's own figure is 50 by construction, and lowers the alignment, non-orthogonality, and connector-crossing error rates to 3.4%, 7.2%, and 1.7%.
Community
Agent2Figure (AAAI 2027) draws the method figure of a paper as an editable vector graphic. A language model declares what the figure contains and which sentences of the paper each element comes from; a deterministic compiler then solves every coordinate.
๐งญ Grounded in the paper. Elements of the FigureSpec cite the text they come from, so the figure says what the paper says.
๐ Coordinates are solved, not predicted. Glyph-exact text measurement, row and column alignment and obstacle-avoiding orthogonal routing come from the compiler. An independent SVG auditor reports any remaining overlap or misalignment, and fixes are patches to the spec, not to pixels.
๐๏ธ Ready for the paper. TeX math, venue widths with a fixed point-size type scale, and output as SVG, selectable-text PDF and native PowerPoint, plus multi-panel data charts in the same palette.
๐งฉ Works from any agent. A CLI (a2f) and an MCP server (a2f-mcp) for Claude Code, Codex, Cursor and Antigravity; the project page runs the compiler in the browser.
Get this paper in your agent:
hf papers read 2612.02439 Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash Models citing this paper 0
No model linking this paper
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper
Collections including this paper 0
No Collection including this paper