Plotly for Highly Customizable Print-Ready Data Visualization
Plotly isn't just for interactive graphs. It was designed from Day 1 to be extremely flexible, customizable, and capable for print-ready reports.
When LLMs are asked about different charting libraries, they like to present a "balanced" opinion, and will say things like "Use Plotly for interactive graphs and [...] library for customizable, static charts." It's really a false dichotomy! And with the latest Plotly.js 4.0 release, there are more options to customize Plotly graphs than ever.
Plotly has a few unique aspects to its architecture that make it exceptional for highly custom graphics:
- Declarative figure structure, with thousands of customization options.
- SVG rendering engine so that the exports are crisp and publication-quality.
- Low level shapes and annotations, with both relative positioning ("paper" coordinates) and data positioning relative to the axis, that can be used to create custom visuals beyond the built-in trace types.
- A highly flexible axes system that handles things like inset figures, small multiples, shared axes, and more
- First class trace types for almost all graph types, including maps, 3D charts, scientific and statistical visualizations, and more.
- A WebGL engine for handling high performance rendering when SVG rendering breaks down (around 40k points).
- Wide font support including LaTeX rendering of math equations.
- Multiple export options that all use the exact same rendering engine for consistency: interactive graphs on the web browser, SVG, PNG, PDF exports, and responsive charts within data applications.
- Plotly's rendering engine uses perhaps the most widely deployed, battle-tested rendering engine in all of software's history: web browser technology. The browser is one of the best, if not the best, software for rendering vector graphics. It's fast, semantic, used by billions every day, has excellent long term support, and cross-platform. The cross-platform piece is essential: many graphics engines have to build separate rendering engines for each operating system which can be the source of bugs, inconsistencies, maintenance, and iffy support. Since Plotly's graphics engine uses browser technology, it works across all platforms and, most importantly, is consistent across all platforms. But the fact that it uses browser technology for static image export is largely an implementation detail; Plotly has done a lot of excellent work to make this fact invisible for static image export. Static image export uses the browser's rendering technology in a "headless" way, so it is done programmatically without actually opening the browser; the fact that Plotly uses browser technology to render graphs isn't something that you need to know when rendering print-ready graphics with Plotly, it's just an implementation detail that helps ensure that rendering static graphs with Plotly just works. It's also lightweight - the latest releases of Kaleido will use the version of Chrome that is already on the user's machine (another win for consistency, too, since this is the same browser technology that users will use to consume other vector graphics on the web). Plotly's decision in 2012 to use browser technology for both interactive graphs and static graphs has really stood the test of time.
Here's a post of 32 highly customized charts - all rendered as static images using Plotly's built-in image export capabilities - to show a sample of what's possible. See also my compendium of canonical charts for another set of charts that really flex the breadth of this library. Enjoy!
Quick AI disclaimer: All of the written blog post text on this website is written without AI assistance. The code examples, including those below, were all written with coding agents. And hey, that's the point! Coding agents are exceptional at writing Plotly code, and creating highly customizable, beautiful data visualizations is easier than ever these days.
Every chart is a plain plotly.graph_objects figure written to
disk by Kaleido
as a 2× PNG and an SVG. Nothing on this page is interactive: there is no
plotly.js loaded here. Each Code link opens the generator script
alongside an interactive rendering of the same figure JSON.
Annotated line with warming stripes
NASA GISTEMP v4 · Code · SVG · PNG
Climate spiral
NASA GISTEMP v4, monthly · Code · SVG · PNG
Sea ice spaghetti
NSIDC Sea Ice Index · Code · SVG · PNG
Connected scatterplot
OECD Health Statistics via seaborn-data · Code · SVG · PNG
Slope chart
Our World in Data · Code · SVG · PNG
Small multiples
Gapminder via plotly.express · Code · SVG · PNG
Anscombe's quartet
R datasets package · Code · SVG · PNG
Minard's map
HistData (Wilkinson's transcription) · Code · SVG · PNG
Nightingale's rose
Population pyramid
World Bank API · Code · SVG · PNG
County choropleth
BLS via plotly/datasets · Code · SVG · PNG
Energy Sankey
plotly.js sankey_energy mock (DECC) · Code · SVG · PNG
Exoplanet scatter
NASA Exoplanet Archive · Code · SVG · PNG
Stacked area with direct labels
Global Carbon Budget via Our World in Data · Code · SVG · PNG
Journal figure
synthetic, seeded · Code · SVG · PNG
Raincloud plot
palmerpenguins via seaborn-data · Code · SVG · PNG
Ridgeline plot
nycflights13 weather table · Code · SVG · PNG
Bump chart
Our World in Data · Code · SVG · PNG
Sparkline table
plotly.express stocks · Code · SVG · PNG
Waterfall chart
Apple Form 10-K, FY2024 · Code · SVG · PNG
Dumbbell chart
World Bank API · Code · SVG · PNG
Calendar heatmap
nycflights13 weather table · Code · SVG · PNG
Beeswarm
Gapminder via plotly.express · Code · SVG · PNG
Forest plot
synthetic, seeded · Code · SVG · PNG
Terrain surface
R datasets::volcano · Code · SVG · PNG
Ball and stick molecule
RCSB Protein Data Bank, 1CRN · Code · SVG · PNG
Earthquake map
USGS real-time feed, M2.5+ past month · Code · SVG · PNG
Borehole striplog
Kennetcook #2 (P-129), Agile striplog · also in the compendium · Code · SVG · PNG
Pattern fills, black and white
Global Carbon Budget via Our World in Data · Code · SVG · PNG
City map, 139,000 points
DataSF street tree census · Code · SVG · PNG
Street-level map
DataSF street trees · DataSF mobile food permits · Code · SVG · PNG
Clinical trial bar chart
synthetic, seeded · Code · SVG · PNG