What Plotly is
Plotly is a charting library for Python, R, and JavaScript that renders figures as interactive HTML. A Plotly chart in a notebook or a web page responds to the reader: hover a point for exact values, drag to zoom into a cluster, click a legend entry to hide a series, rotate a three-dimensional surface.
The distinction from a static plotting library is not decoration but information density. A static figure must choose in advance which detail to show; an interactive one can carry the whole dataset and let the reader decide what to look at. For a supplementary figure with two thousand points, or a spectral surface a reader needs to see from another angle, that is a real difference in what can be communicated. It is also why Plotly is the wrong tool for a printed page, where interaction does not exist and the figure has to make its argument statically.
Why researchers use it
- Interactivity by default — hover, zoom, and pan on every chart with no extra code, which is what turns a supplementary figure into something reviewers actually explore.
- Plotly Express one-liners — sophisticated statistical charts, faceting, and colour mapping in a single call, often shorter than the Matplotlib equivalent.
- Genuine 3D — rotatable surfaces and scatter plots that are far more informative live than as a fixed projection.
- Dash — turn an analysis into a shareable web application without writing JavaScript, which is the most accessible route from a script to a tool colleagues can use.
- The same API across Python and R — useful in mixed-language groups where a shared plotting vocabulary saves argument.
Where it fits in a research workflow
Plotly belongs to outputs that live on a screen: exploratory analysis in Jupyter, HTML supplementary materials, dashboards, and companion apps for a paper. Its output format is a web page.
That determines the split with matplotlib cleanly. The printed figure in the manuscript comes from Matplotlib, under your house style, meeting the journal’s specification; the interactive version accompanying it online comes from Plotly. Both can be generated from the same analysis, and that pairing — static in the PDF, interactive in the supplement — is the arrangement worth adopting rather than picking one. Downstream, an interactive HTML figure can be deposited with the paper’s data on Zenodo, or a Dash app hosted alongside a model on Hugging Face Spaces.
Getting started
An afternoon, and start with Express.
pip install plotlyin your project environment, thenpx.scatter(df, x=..., y=..., color=...)in a notebook. It renders immediately and interactively, which is the whole demonstration.- Export a standalone interactive file with
fig.write_html(). That single file opens in any browser with no dependencies and is what you attach as a supplement. - For static export — PNG or PDF — install
kaleidoand expect to spend time tuning sizes and fonts, because print output is not what Plotly optimises for. - The step people skip: check that your figure still communicates when frozen. Reviewers print things, PDFs get read on planes, and a figure whose meaning depends on hovering is a figure that fails for a meaningful fraction of your readers.
Plotly vs the alternatives
| Alternative | Does it better | Pick it if |
|---|---|---|
| matplotlib | Print-quality static figures with exact dimensional control | The figure goes in a manuscript |
| ggplot2 in RStudio | A coherent grammar and excellent static defaults | You work in R and the output is static |
| Bokeh / Altair | Different interactive models with cleaner grammars | You have a specific preference; all three are reasonable |
| Hugging Face Spaces | Hosting the resulting app for others to use | You have built something worth sharing |
Plotly wins where interaction adds information. It loses to Matplotlib on everything destined for print.
Cost, licensing, and your data
The Python and R libraries and Dash are open source under the MIT licence, free and complete — you can build and self-host a full dashboard with no payment. The commercial layer is Dash Enterprise, which adds hosting, authentication, and deployment tooling for organisations; the pressure toward it in documentation and marketing is noticeable but does not restrict the open library.
Rendering happens locally and figures are self-contained HTML, so nothing leaves your machine unless you host it somewhere. The one thing to notice is that an interactive HTML figure embeds the underlying data — that is how the hover works. A supplementary figure therefore ships your dataset to anyone who downloads it, which is usually fine and is occasionally a disclosure you did not intend to make.
The honest review
Strengths. For data a reader should explore rather than merely view, Plotly is the best default in the Python ecosystem: interaction for free, sensible statistical defaults through Express, and 3D that is genuinely useful rather than a gimmick. Dash is the most researcher-accessible path from an analysis to a working web application, and for a paper with an interactive companion it is the shortest route there.
Limitations. Static export is a second-class citizen. Getting a Plotly figure to meet a journal’s dimensional and typographic specification takes noticeably more fiddling than Matplotlib, and the kaleido dependency is one more thing to pin. Interactive figures embed in HTML supplements, not in PDFs, so they do not go in the manuscript. Generated files get large when the dataset does. The open-source library shades into Dash Enterprise upsells often enough to be tiresome. And there is a subtler risk: interactivity encourages figures that carry everything and argue nothing, on the assumption the reader will find the point themselves.
Verdict. Adopt it for exploratory analysis, HTML supplements, and dashboards — it is the right tool for all three. Skip it for print figures, where matplotlib with a house style is the reproducible standard. The condition that flips the answer is the destination, and the correct answer is often both: static in the paper, interactive in the supplement.
Common questions
Is Plotly free?
Yes — the Python and R libraries and Dash are open source under the MIT licence, free and fully functional including self-hosting. Dash Enterprise is a separate commercial product for organisational hosting and authentication.
Can I use Plotly figures in a journal article?
Only as static exports, via kaleido — and getting them to meet a figure specification takes more work than matplotlib. Interactive Plotly figures belong in HTML supplementary materials, where the interaction actually works.
Plotly or Matplotlib?
Matplotlib for anything printed: exact control, journal-compliant vector output, and a reproducible style file. Plotly for anything read on a screen where exploring the data adds information. Generating both from one analysis is a reasonable and common arrangement.