TL;DR
The paper introduces RealChart2Code, a large-scale benchmark designed to evaluate Vision-Language Models (VLMs) on their ability to reverse-engineer complex, multi-panel data visualizations into executable code. Testing 14 leading VLMs reveals a dramatic "complexity gap," where even state-of-the-art models experience up to a 50% performance drop when transitioning from simple synthetic charts to authentic, data-driven layouts.
What Problem Does This Paper Address?
While modern VLMs excel at generating code for simple, single-panel charts, real-world data science relies heavily on intricate, multi-plot dashboards and composite layouts. Existing benchmarks for chart-to-code generation fail to capture this reality because they predominantly feature simplified, synthetically generated, or single-panel plots. Furthermore, many suffer from potential data leakage due to reliance on pre-existing internet chart-code pairs.
To truly serve practical user needs—such as recovering underlying visualization logic to edit, extend, or reuse charts—models must be able to handle large-scale raw data, complex spatial layouts, and multi-turn conversational code refinement. This paper addresses the lack of a rigorous, realistic evaluation framework for these advanced capabilities.
Methods
The authors frame chart-to-code generation as a conditional code generation problem and evaluate it across three distinct, core tasks:
- Chart Replication: Generating code to match a reference chart image from scratch.
- Chart Reproduction: Replicating the chart given both the image and the authentic raw data files.
- Chart Refinement: Correcting a flawed chart through multi-turn dialogue based on user feedback.
To evaluate the models, the authors implement a two-pronged approach:
- Functional Correctness (Pass Rate): Code is executed within an isolated Docker sandbox (Python 3.13) to ensure it runs without errors.
- Visual Accuracy: Valid outputs are scored on a 3-point scale (0, 1, 2) across eight criteria (such as chart type, spatial layout, and color scheme) using a multi-agent judging panel. For the reproduction task, data alignment is evaluated programmatically via code-level comparison rather than relying solely on visual inspection.
Datasets
The authors introduce the RealChart2Code benchmark, which consists of 2,896 instances derived from 1,036 high-quality open-source datasets from Kaggle (comprising 3,271 raw data files and roughly 860 million rows).
The benchmark features:
- 1,016 instances for Chart Replication
- 1,016 instances for Chart Reproduction
- 864 instances for Chart Refinement
- A diverse taxonomy covering 7 high-level analytical intents and 50 distinct plot types (e.g., line charts, heatmaps, parallel coordinates, and violin plots).
Key Insights and Ideas
- The "Complexity Gap": Top-tier proprietary models that achieve near-perfect scores (~96%) on existing benchmarks see their performance halved on RealChart2Code. This indicates that current benchmarks have saturated and fail to differentiate true visual reasoning capabilities from simple pattern memorization.
- Divergent Failure Patterns: Open-weight models (e.g., Qwen3-VL, InternVL) frequently fail due to Syntax and Execution Errors, often hallucinating libraries or struggling with basic spatial layout. In contrast, proprietary models (e.g., Claude-4.5, GPT-5.1) write clean code but fail due to Data Mapping Errors—meaning they arrange the layout correctly but map data series to the wrong axes or visual attributes.
- "Regressive Editing" in Refinement: During multi-turn conversations, models frequently suffer from an error mode where successfully fixing a user-specified local error inadvertently introduces new errors into previously correct parts of the code.
Key Results
The benchmark evaluated 14 prominent VLMs (5 proprietary, 9 open-weight):
- Claude-4.5-Opus achieved the highest overall score of 8.2 (out of 10), closely followed by Gemini-3-Pro-Preview at 8.1.
- GPT-5.1 lagged significantly behind the top tier, scoring 5.4.
- A massive performance gap exists between proprietary and open-weight models. The top-performing open-weight models, Qwen3-VL-235B and Intern-VL-3.5-241B, scored only 3.6 and 3.4 respectively—less than half the score of the leading proprietary models.
Limitations and Future Work
The authors note two primary limitations:
- Library Constraint: The benchmark's code implementations are currently confined to Matplotlib. While Matplotlib's imperative nature serves as a robust proxy for general plotting logic, expanding to other libraries (like Plotly or Vega-Lite) remains future work.
- Judge Granularity: Although the multi-agent LLM judge correlates strongly with human evaluation ($\kappa = 0.83$), it can occasionally miss subtle visual artifacts like minor text overlaps or precise color nuances.
Future research directions include developing automated pipelines to generate high-quality synthetic data that mimics these complex layouts to help train and improve future VLMs.
Summary updated