Skip to main content
QUICK REVIEW

[Paper Review] Plots.jl -- a user extendable plotting API for the julia programming language

Simon Christ, Daniel Schwabeneder|arXiv (Cornell University)|Apr 19, 2022
Advanced Computational Techniques and ApplicationsComputer Science8 citations
TL;DR

Plots.jl introduces a unified, user-extensible plotting API for the Julia language that decouples plot specification from rendering backends via a recipe system. This allows users to write platform-agnostic plotting code and switch backends seamlessly, while package authors can extend visualization support for custom types—like differential equation solutions or phylogenetic trees—without bloating package load times.

ABSTRACT

There are many excellent plotting libraries. Each excels at a specific use case: one is particularly suited for creating printable 2D figures for publication, another for generating interactive 3D graphics, while a third may have excellent LATEX integration or be ideal for creating dashboards on the web. The aim of Plots.jl is to enable the user to use the same syntax to interact with a range of different plotting libraries, making it possible to change the library that does the actual plotting (the backend) without needing to touch the code that creates the content – and without having to learn multiple application programming interfaces (API). This is achieved by separating the specification of the plot from the implementation of the graphical backend. This plot specification is extendable by a recipe system that allows package authors and users to create new types of plots, as well as to specify how to plot any type of object (e.g. a statistical model, a map, a phylogenetic tree or the solution to a system of differential equations) without depending on the Plots.jl package. This design supports a modular ecosystem structure for plotting and yields a high code reuse potential across the entire Julia package ecosystem. Plots.jl is publicly available at https://github.com/JuliaPlots/Plots.jl.

Motivation & Objective

  • To address the high 'time to first plot' latency in Julia by decoupling plotting logic from rendering backends.
  • To enable package authors to provide visualization support for their custom types without increasing their package's load time.
  • To unify access to diverse plotting libraries (e.g., for 2D, 3D, web, or LaTeX output) under a single, consistent API.
  • To support a modular, composable ecosystem where new plot types and backends can be added independently.

Proposed method

  • Employs Julia's multiple dispatch to route plot calls to appropriate backends based on input types.
  • Introduces a 'recipe' system that allows users and package authors to define how to render any custom type (e.g., ODE solutions, maps, trees) using keyword arguments and seriestype.
  • Separates plot specification (via the `plot` function) from rendering (via backend-specific backends like PGFPlotsX or GR).
  • Uses the lightweight RecipesBase.jl dependency to define recipes without requiring full Plots.jl dependency at package load time.
  • Supports hierarchical attribute control (plot, subplot, axis, series) through keyword arguments for fine-grained customization.
  • Enables backend switching via a single function call (e.g., `pgfplotsx()`), allowing users to change rendering output without modifying plot code.

Experimental results

Research questions

  • RQ1Can a unified plotting API be built in Julia that abstracts away backend differences while preserving performance and extensibility?
  • RQ2How can package authors provide visualization support for their custom types without increasing their package's load time?
  • RQ3To what extent does a recipe-based system enable interoperability across multiple plotting backends in a modular ecosystem?
  • RQ4Can a single API syntax support diverse use cases—from publication-quality 2D figures to interactive 3D graphics and web dashboards?
  • RQ5How does the recipe system enable high code reuse and extensibility across the Julia package ecosystem?

Key findings

  • Plots.jl achieved widespread adoption, being named the community's favorite Julia package in both the 2019 and 2020 Julia Language Surveys, with 47% of users listing it as a favorite.
  • The recipe system allows package authors to define visualizations for new types (e.g., ODE solutions, statistical models) with minimal dependencies, using only RecipesBase.jl.
  • Over 300 packages in the Julia registry now include Plots.jl recipes, demonstrating strong ecosystem integration and reuse potential.
  • The package supports over 500–2000 daily downloads, indicating sustained usage in scientific computing, teaching, and publication workflows.
  • The separation of specification and backend enables seamless switching between backends (e.g., PGFPlotsX for LaTeX output, GR for interactive plots) without changing user code.
  • The recipe system has inspired similar implementations in other Julia plotting libraries, such as Makie.jl, confirming its architectural influence.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.