figmirror-bench
收藏资源简介:
FigMirror是一个用于科学图表到代码生成任务的基准数据集,包含465个出版物风格的Matplotlib图表,每个图表都附带精确生成其图像的脚本。数据集分为三个子集:repro(69个样本,用于重现已发表论文中的图表)、aug(348个样本,基于种子图表进行增强)、transfer(48个样本,作为冻结的转移集)。每个样本包含渲染后的图表图像(figure.png)、生成图像的Python脚本(code.py)、原始参考图像(reference.png)、绘图数据(data.csv或data.npz)以及元数据(meta.json)。图表类型涵盖12种常见科学图表类型,如条形图、折线图、散点图、箱线图等。该数据集可用于图像到代码、代码到图像以及图表生成领域的模型评估与训练,特别强调可重复性:repro和aug子集中的脚本在隔离环境中运行两次可产生完全相同的输出。
FigMirror is a benchmark dataset for the task of scientific figure-to-code generation, containing 465 publication-style Matplotlib figures, each accompanied by the exact script that generates its image. The dataset is divided into three subsets: repro (69 samples, for reproducing figures from published papers), aug (348 samples, augmented based on seed figures), and transfer (48 samples, as a frozen transfer set). Each sample includes the rendered figure image (figure.png), the Python script to generate the image (code.py), the original reference image (reference.png), plotting data (data.csv or data.npz), and metadata (meta.json). The figure types cover 12 common scientific chart types, such as bar charts, line charts, scatter plots, box plots, etc. The dataset can be used for model evaluation and training in the fields of image-to-code, code-to-image, and figure generation, with a particular emphasis on reproducibility: scripts in the repro and aug subsets produce identical outputs when run twice in an isolated environment.
FigMirror benchmark 数据集概述
基本信息
- 许可证: CC-BY-4.0
- 任务类型: 图像到文本、文本到图像
- 语言: 英语
- 规模: n<1K(共465个样本)
- 内容: 465张出版级matplotlib科学图表,每张均附带可精确生成该图的Python脚本
数据集划分
| 配置 | 样本数 | 任务描述 |
|---|---|---|
repro |
69 | 复现已发表的论文图表 |
aug |
348 | 基于代码种子的图表增强 |
transfer |
48 | 冻结交付的迁移集 |
可复现性保证
repro和aug配置: 每个figure.png与code.py生成的图像逐字节一致。所有脚本在隔离环境中运行两次,确保确定性输出。脚本自包含,无外部导入、无绝对路径、随机种子已固定。transfer配置: 不保证可复现性。48个样本中30个会写入不同文件名,18个无法运行。
文件结构
<config>/<id>/ figure.png code.py reference.png data.csv meta.json caption.txt data_echo.md # repro / aug 中可用
- 所有
reference文件均为上游原始发布文件,逐字节原样保留,未经过任何重渲染、重编码或修复。 data_echo.md说明数据是真实数据、从图表追溯还是合成数据。
元数据字段
每个样本配备meta.json,每个配置提供metadata.jsonl(每行一个样本)。关键字段包括:id、track、chart_type、panel_mode、provenance、reference_kind、source_url、license、seed_id、upstream_id、figure_sha256、code_sha256等。
空字段说明
source_url: 仅在3个repro和2个transfer样本中为空(这些图是自行绘制的)。seed_id等种子字段: 仅在repro和transfer中为空(论文复现无种子)。human_verdict和frozen: 仅在transfer配置中有效。
图表类型分布(12类)
| 代码 | 类型 | 样本数 |
|---|---|---|
| T1 | 柱状图 | 139 |
| T2 | 折线图 | 85 |
| T3 | 散点图 | 39 |
| T4 | 分布图 | 29 |
| T5 | 箱线图/小提琴图 | 35 |
| T6 | 热力图 | 29 |
| T7 | 二维场图 | 31 |
| T8 | 三维图 | 14 |
| T9 | 网络/树状图 | 6 |
| T10 | 极坐标/径向图 | 31 |
| T11 | 标准差带图 | 20 |
| T12 | 复合图 | 7 |
统计信息
- 面板模式: 374个多面板,91个单面板
- 来源归属: 论文109个,数据集18个,FigMirror原创5个,种子333个
- 来源许可证: CC-BY-4.0 (338个)、arXiv非独占 (66个)、PMC OA (40个)、Apache-2.0 (18个)、CVF开放获取 (3个)
- 增强种子来源: ChartNet (151)、Chart2Code (150)、Chart2NCode (31)、ChartMimic (15)、ChartGen (1)
运行环境
- Python 3.13.7
- Matplotlib 3.10.9
- NumPy 2.4.4
- 后端: Agg
- 渲染命令:
cd <样本目录> && python code.py(重写figure.png)
其他matplotlib版本可能产生亚像素级差异,记录的版本下可实现字节级一致性。





