Lune

ACL2021Top-tier venue

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 Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

6 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Evaluation of LLMs on Syntax-Aware Code Fill-in-the-Middle Tasks cites DS-1000: A Natural and Reliable Benchmark for Data Science Code Generation
  • VizSmith: Automated Visualization Synthesis by Mining Data-Science Notebooks cites Falx: Synthesis-Powered Visualization Authoring
  • Contextualized Data-Wrangling Code Generation in Computational Notebooks cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Contextualized Data-Wrangling Code Generation in Computational Notebooks cites VizSmith: Automated Visualization Synthesis by Mining Data-Science Notebooks
  • Contextualized Data-Wrangling Code Generation in Computational Notebooks cites DS-1000: A Natural and Reliable Benchmark for Data Science Code Generation
  • TransRepair: Context-aware Program Repair for Compilation Errors cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Falx: Synthesis-Powered Visualization Authoring cites Wrex: A Unified Programming-by-Example Interaction for Synthesizing Readable Code for Data Scientists
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers6

  1. 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
  2. Evaluation of LLMs on Syntax-Aware Code Fill-in-the-Middle TasksLinyuan Gong, Sida Wang, Mostafa Elhoushi, Alvin CheungICML 2024 · 33 citations
  3. TransRepair: Context-aware Program Repair for Compilation ErrorsXueyang Li, Shangqing Liu, Ruitao Feng, Guozhu Meng et al.ASE 2022 · 31 citations
  4. VizSmith: Automated Visualization Synthesis by Mining Data-Science NotebooksRohan Bavishi, Shadaj Laddad, Hiroaki Yoshida, Mukul R. Prasad et al.ASE 2021 · 7 citations
  5. Contextualized Data-Wrangling Code Generation in Computational NotebooksJunjie Huang, Daya Guo, Chenglong Wang, Jiazhen Gu et al.ASE 2024 · 5 citations

Builds on4

  1. CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan et al.EMNLP Findings 2020 · 2,828 citations
  2. 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
  3. 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
  4. Falx: Synthesis-Powered Visualization AuthoringChenglong Wang, Yu Feng, Rastislav Bodík, Isil Dillig et al.CHI 2021 · 35 citations

Related papers

  1. PlotCraft: Pushing the Limits of LLMs for Complex and Interactive Data VisualizationJiajun Zhang, Jianke Zhang, Zeyu Cui, Jiaxi Yang et al.ICML 2026
  2. Visualization by exampleChenglong Wang, Yu Feng, Rastislav Bodík, Alvin Cheung et al.POPL 2020 · 36 citations
  3. NL2Viz: natural language to visualization via constrained syntax-guided synthesisZhengkai Wu, Vu Le, Ashish Tiwari, Sumit Gulwani et al.FSE 2022 · 10 citations
  4. PlotGen-Bench: Evaluating VLMs on Generating Visualization Code from Diverse Plots across Multiple LibrariesYi Zhao, Zhen Yang, Shuaiqi Duan, Wenmeng Yu et al.ACL Findings 2026
  5. Dashboard2Code: Evaluating Multimodal Models on Reconstructing Interactive DashboardsTianhao Niu, Ziyu Han, Qiguang Chen, Shiqi Zhou et al.ACL 2026
Dusk over the sea between two cliffs drawn in fine vertical lines