PlotCoder: Hierarchical Decoding for Synthesizing Visualization Code in Programmatic Context
Xinyun Chen, Linyuan Gong, Alvin Cheung, Dawn Song
Abstract
Creating effective visualization is an important part of data analytics. While there are many libraries for creating visualizations, writing such code remains difficult given the myriad of parameters that users need to provide. In this paper, we propose the new task of synthesizing visualization programs from a combination of natural language utterances and code context. To tackle the learning problem, we introduce PLOTCODER, a new hierarchical encoder-decoder architecture that models both the code context and the input utterance. We use PLOTCODER to first determine the template of the visualization code, followed by predicting the data to be plotted. We use Jupyter notebooks containing visualization programs crawled from GitHub to train PLOTCODER. On a comprehensive set of test samples from those notebooks, we show that PLOTCODER correctly predicts the plot type of about 70% samples, and synthesizes the correct programs for 35% samples, performing 3-4.5% better than the baselines. 1
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext bbe35aa2-0c7b-41e9-8d4d-ebe2bbc196e6Cited by top-tier papers6
- DS-1000: A Natural and Reliable Benchmark for Data Science Code GenerationYuhang Lai, Chengxi Li, Yiming Wang, Tianyi Zhang et al.ICML 2023 · 504 citations
- Evaluation of LLMs on Syntax-Aware Code Fill-in-the-Middle TasksLinyuan Gong, Sida Wang, Mostafa Elhoushi, Alvin CheungICML 2024 · 33 citations
- TransRepair: Context-aware Program Repair for Compilation ErrorsXueyang Li, Shangqing Liu, Ruitao Feng, Guozhu Meng et al.ASE 2022 · 31 citations
- VizSmith: Automated Visualization Synthesis by Mining Data-Science NotebooksRohan Bavishi, Shadaj Laddad, Hiroaki Yoshida, Mukul R. Prasad et al.ASE 2021 · 7 citations
- Contextualized Data-Wrangling Code Generation in Computational NotebooksJunjie Huang, Daya Guo, Chenglong Wang, Jiazhen Gu et al.ASE 2024 · 5 citations
Builds on3
- Wrex: A Unified Programming-by-Example Interaction for Synthesizing Readable Code for Data ScientistsIan Drosos, Titus Barik, Philip J. Guo, Robert DeLine et al.CHI 2020 · 110 citations
- RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL ParsersBailin Wang, Richard Shin, Xiaodong Liu, Oleksandr Polozov et al.ACL 2020 · 39 citations
- Falx: Synthesis-Powered Visualization AuthoringChenglong Wang, Yu Feng, Rastislav Bodík, Isil Dillig et al.CHI 2021 · 35 citations
Related papers
- PlotCraft: Pushing the Limits of LLMs for Complex and Interactive Data VisualizationJiajun Zhang, Jianke Zhang, Zeyu Cui, Jiaxi Yang et al.ICML 2026
- Visualization by exampleChenglong Wang, Yu Feng, Rastislav Bodík, Alvin Cheung et al.POPL 2020 · 36 citations
- NL2Viz: natural language to visualization via constrained syntax-guided synthesisZhengkai Wu, Vu Le, Ashish Tiwari, Sumit Gulwani et al.FSE 2022 · 10 citations
- Dashboard2Code: Evaluating Multimodal Models on Reconstructing Interactive DashboardsTianhao Niu, Ziyu Han, Qiguang Chen, Shiqi Zhou et al.ACL 2026
- Outline, Then Details: Syntactically Guided Coarse-To-Fine Code GenerationWenqing Zheng, S. P. Sharan, Ajay Kumar Jaiswal, Kevin Wang et al.ICML 2023 · 35 citations
