PlotCraft: Pushing the Limits of LLMs for Complex and Interactive Data Visualization
Abstract
Recent Large Language Models (LLMs) have demonstrated remarkable proficiency in code generation. However, their ability to create complex visualizations for scaled and structured data remains largely unevaluated and underdeveloped. To address this gap, we introduce PlotCraft, a new benchmark featuring 1k challenging visualization tasks that cover a wide range of topics, such as finance, scientific research, and sociology. The benchmark is structured around seven high-level visualization tasks and encompasses 48 distinct chart types. Crucially, it is the first to systematically evaluate both single-turn generation and multi-turn refinement across a diverse spectrum of task complexities. Our comprehensive evaluation of 23 leading LLMs on PlotCraft reveals obvious performance deficiencies in handling sophisticated visualization tasks. To bridge this performance gap, we develope SynthVis-30K, a large-scale, high-quality dataset of complex visualization code synthesized via a collaborative agent framework. Building upon this dataset, we develope PlotCraftor, a novel code generation model that achieves strong capabilities in complex data visualization with a remarkably small size. Across VisEval, PandasPlotBench, and our proposed PlotCraft, PlotCraftor shows performance comparable to that of leading proprietary approaches. Especially, on hard task, Our model achieves over 50\% performance improvement. We will release the benchmark, dataset, and code at \href{https://anonymous.4open.science/r/PlotCraft-E320}{PlotCraft anonymous repository}.
Lay Summary
Data visualization — turning numbers and data into charts and graphs — is a critical tool for understanding complex information in fields like finance, scientific research, and sociology. While AI language models have become increasingly capable of writing code, their ability to automatically generate sophisticated, publication-ready visualizations remains poorly understood and largely untested. To address this, we introduce PlotCraft, a new benchmark containing 1,000 challenging visualization tasks spanning diverse topics and 48 different chart types. For the first time, PlotCraft systematically tests AI models not only on creating visualizations from scratch, but also on refining and improving them through multiple rounds of feedback — much like how a human developer would iteratively polish a chart. We tested 23 state-of-the-art AI models on PlotCraft and found that even the best models struggle significantly with complex visualization tasks. To close this gap, we created SynthVis-30K, a large collection of 30,000 high-quality visualization examples generated by a team of collaborating AI agents. Using this dataset, we trained PlotCraftor, a compact yet powerful model specialized in data visualization. Despite its small size, PlotCraftor performs on par with much larger commercial AI systems, and on the most difficult tasks, it achieves over 50% better performance than existing approaches. We will publicly release our benchmark, dataset, and code to support future research in this area.