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%.