skillfed

mpld3

D3 Viewer for Matplotlib

mpld3 v0.5.12 580.2K downloads/30d#5,914 on PyPI2,413
Permissive license BSD 3-clause AGING released

What it is and what it does

mpld3 bridges matplotlib and the web by converting static plots into interactive D3.js visualizations. It parses matplotlib figures using the mplexporter framework, outputs them as JSON, and renders them in a browser with pan, zoom, and hover interactivity. The package is pure Python and lightweight, making it straightforward to add to existing matplotlib workflows.

Typical use is embedding interactive plots in IPython notebooks or generating standalone HTML files for sharing. Many core matplotlib features are supported, though some advanced features like tick formatting, certain legend options, and twin axes remain unsupported. The package is in beta status and aging—the original author is no longer actively maintaining it, though the repository accepts pull requests.

Use it for:

  • Embed interactive matplotlib plots in IPython notebooks for exploratory data analysis.
  • Export static matplotlib figures as standalone HTML files for sharing with non-technical stakeholders.
  • Add pan, zoom, and hover tooltips to scientific plots without rewriting visualization code.
  • Create web-based dashboards combining matplotlib plots with D3.js interactivity.
  • Prototype interactive visualizations quickly from existing matplotlib code before building custom D3 solutions.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Converts matplotlib plots to interactive D3.js visualizations in the browser, enabling exploration and interaction with static graphics through a web-based viewer.

Yes, if you need quick interactivity on matplotlib plots and can tolerate aging maintenance. The package is stable, has no known vulnerabilities, and installs with low friction. However, verify compatibility with your Python and matplotlib versions first—classifiers suggest old version support, and the maintainer has limited availability for bug fixes. Best suited for exploratory work or prototyping rather than production systems requiring active support.

Install

mpld3 on PyPI

pip

pip install mpld3

uv

uv add mpld3

poetry

poetry add mpld3

Installing mpld3

Before you install

Low install friction with pure-Python distribution. Maintenance is aging—the lead maintainer states limited availability, though pull requests are reviewed. Last release was 282 days ago; repository remains active with 2413 stars.

License in practice

BSD 3-clause is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

import matplotlib.pyplot as plt
import mpld3

fig, ax = plt.subplots()
ax.plot([1, 2, 3], [1, 2, 3])
html = mpld3.fig_to_html(fig)
# Open html in browser or embed in IPython notebook

Requires matplotlib 2.2.2 and jinja2 2.7+; classifiers list Python 2.6–2.7 and 3.3–3.4, though requires_python is unspecified.

Verify before relying

  • Whether the package actually works with modern Python versions (3.8+) despite classifiers listing only 2.6–3.4.
  • Current compatibility with recent matplotlib versions beyond the stated 2.2.2 requirement.
  • Whether IPython notebook integration remains functional with current Jupyter versions.

Package facts

License BSD 3-clause (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 2 — jinja2, matplotlib
Maintenance aging — 282 days since the last release
Last repo commit
First released
Downloads 580,157/month — #5,914 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: mpld3-0.5.12-py3-none-any.whl

Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishProgramming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4

Tags

matplotlib to d3 converterinteractive matplotlib plotsd3 visualization from matplotlibbrowser-based plot viewermatplotlib web exportd3js matplotlib bridgeinteractive chart browser
visualizationd3jsjupyter-friendly

More Graphics packages