Skip to content

About

[arxiv'26] From Pixel to Coding: Evaluating the Figure Reproduction Capabilities of MLLMs

Resources

Stars

5 stars

Watchers

0 watching

Forks

Latest commit

 

History

17 Commits

Folders and files

Repository files navigation

From Pixel to Coding: Evaluating the Figure Reproduction Capabilities of MLLMs

Evaluating MLLMs on figure reproduction, integrating multimodal comprehension and generation.

Zijian Chen1,2, Zhengyu Chen1, Bohan Liang2, Lirong Deng3, Yushuo Zheng1,2, Yanwei Jiang1,2, Qi Jia2, Kaiwei Zhang2,Wenjun Zhang1, Guangtao Zhai1,2,*
1Shanghai Jiao Tong University, 2Shanghai AI Laboratory, 3Macao Polytechnic University
*Corresponding author.

Abstract: Our benchmark offers (1) a comprehensive dataset and multi-dimensional evaluation pipeline; (2) an up-to-date leaderboard on MLLM figure reproduction proficiency; and (3) a nuanced understanding of the perceiving and reasoning bottlenecks hindering unified comprehension and generation in current MLLMs.

News

  • [2026/10/9] 🔥 The FigCodeBench dataset will be hosted and version-tracked on Hugging Face, and will be permanently accessible at CCZZJJ/FigCodeBench.
  • [2026/10/8] 🔥 Github repo for FigCodeBench is online.

Introduction

Researchers often have a scientific figure and need working code that reproduces it. For a model, this means turning visual structure into a rendered program, not merely describing the image or answering questions about it. We argue that text-only coding tests and image-understanding tests leave this perception-to-generation step unmeasured. This project has proposed a novel evaluation benchmark, aiming to assess the model's ability to observe complex charts (such as line graphs, bar charts, scatter plots, architecture diagrams, etc.) and generate corresponding reproducing code. This not only tests the model's visual perception and fine-grained understanding, but also significantly challenges its logical reasoning and alignment ability in generating code.

Core Contributions

  1. 📈 Comprehensive:Containing 6,194 image-code pairs, covering four programming languages (Python, Matlab, R, and Latex).
  2. 🛠️ Automatic:Providing image-oriented, code-oriented metrics, Mean Machine Opinion Score, and Figure-Code Fidelity metric.
  3. 🏆 24 MLLMs:In-depth experiments were conducted on 24 mainstream MLLMs, revealing the capability boundaries of different models in the "figure-to-code" task, as well as their adaptability to different programming languages and common error patterns.

📊 Dataset & Metrics

Difficulty Distribution

Language Collections

Directory Language Source Code Extension
python/ Python .py
Matlab/ MATLAB .m
R/ R .R
latex/ LaTeX .tex

Figure images are stored in PNG format. Auxiliary information is provided in text files whose names end with _auxinfo.txt.

Subsets and Versions

Each language directory contains two subsets:

  • exemplary/
  • user_generated/

Both subsets follow the same six-directory structure:

<language>/
├── exemplary/
│   ├── code_base/
│   ├── code_variant1/
│   ├── code_variant2/
│   ├── image_base/
│   ├── image_variant1/
│   └── image_variant2/
└── user_generated/
    ├── code_base/
    ├── code_variant1/
    ├── code_variant2/
    ├── image_base/
    ├── image_variant1/
    └── image_variant2/
Directory Contents
code_base/ Source code and auxiliary information for the base collection
code_variant1/ Source code and auxiliary information for the first variant collection
code_variant2/ Source code and auxiliary information for the second variant collection
image_base/ Figure images for the base collection
image_variant1/ Figure images for the first variant collection
image_variant2/ Figure images for the second variant collection

The variant collections contain modified figure-code examples. Their sizes may differ from the base collection, so users should not assume that every base example has both variants.

Visualization Categories

The Python, MATLAB, and R collections organize files into six visualization categories within each code and image directory:

<code_or_image_directory>/
├── Composition/
├── Geospatial/
├── Mathematical/
├── Relational/
├── Statistical/
└── Temporal/

These categories cover composition-based visualizations, geographic plots, mathematical graphics, relationship-based charts, statistical graphics, and time-oriented visualizations.

The LaTeX collection (Conceptual) uses a flatter structure: source code, auxiliary information, and images are stored directly in their respective version directories, without the six category subdirectories.


Environments

Collection Runtime / Toolchain Main Libraries or Settings
Python Python Primarily matplotlib and seaborn; missing packages are automatically detected and installed during execution
MATLAB MATLAB R2023a Additional toolboxes may be required by individual scripts
R R 4.6.0 Missing R packages are automatically detected and installed during execution
LaTeX A TeX distribution providing XeLaTeX xelatex as the rendering engine; 300 DPI for rasterized output

Python

The Python collection primarily uses Matplotlib and Seaborn for plotting. The execution workflow automatically detects missing packages in the local Python environment and installs them during execution, helping prevent figure-generation errors caused by missing dependencies.

pip install matplotlib seaborn
python FigCodeBench/figure_generation/generating_python.py

MATLAB

The MATLAB collection uses MATLAB R2023a as the reference local environment. Some examples may require additional MATLAB toolboxes.

python FigCodeBench/figure_generation/generating_matlab.py

R

The R collection uses R 4.6.0 as the reference environment. The execution workflow automatically detects missing packages in the local R environment and installs them during execution, helping prevent figure-generation errors caused by missing dependencies.

python FigCodeBench/figure_generation/generating_R.py

LaTeX

The LaTeX collection uses XeLaTeX as the configured rendering engine. Install a TeX distribution that includes xelatex, together with the packages and fonts required by the examples.

pip install pdf2image
python FigCodeBench/figure_generation/generating_latex.py

pdflatex may be used for examples that are compatible with it, but it is not the reference engine. Examples that depend on XeLaTeX-specific font or Unicode features may not compile with pdflatex.

Evaluated Models

We select 24 up to date and prevailing MLLMs for evaluation including 11 proprietary MLLMs and 13 open-source MLLMs.

FigCodeBench Leaderboard

Left: Mean Machine Opinion Score (MMOS) versus average cost per problem for various models. Right: Performance comparison of six representative models on different image categories.

Evaluation cost (click to expand)
Results on image-oriented metrics (click to expand)
Results on code-oriented metrics (click to expand)
Results on Mean Machine Opinion Score (MMOS) (click to expand)
  • Detailed MMOS distribution
  • Qualitative results
Results on Figure-Code Fiedlity (FCF) (click to expand)

Contact

Please contact the first author of this paper for queries.

  • Zijian Chen, zijian.chen@sjtu.edu.cn

Citation

Please feel free to cite our paper:

@misc{chen2026pixelcodingevaluatingfigure,
      title={From Pixel to Coding: Evaluating the Figure Reproduction Capabilities of MLLMs}, 
      author={Zijian Chen and Zhengyu Chen and Bohan Liang and Lirong Deng and Yushuo Zheng and Yanwei Jiang and Qi Jia and Kaiwei Zhang and Wenjun Zhang and Guangtao Zhai},
      year={2026},
      eprint={2610.10066},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2610.10066}, 
}

About

[arxiv'26] From Pixel to Coding: Evaluating the Figure Reproduction Capabilities of MLLMs

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages