Comparing
The most powerful data visualization library for the web — bind data to SVG/Canvas elements and transform them with scales, axes, and layouts.
The go-to plotting library for Python — create static, animated, and interactive visualizations with a MATLAB-like API.
| Metric | d3 | matplotlib |
|---|---|---|
| Ecosystem | npm | Python |
| Difficulty | Advanced | Intermediate ✓ |
| Weekly downloads | 5.0M | 25.0M↑ |
| Latest version | v7.9.0 | v3.9.2 |
| Recipes | 1 | 3↑ |
d3 only
Shared
matplotlib only
Custom visualizations that no library supports, journalism/scrollytelling data stories, network graphs, geo maps, animated transitions between data states, or when you need to own every detail.
Scientific plots, publication figures, embedding charts in reports, quick data exploration, custom visualizations that seaborn can't express, or when you need pixel-level control over a chart.
Standard bar/line/pie charts in a product (use Recharts or Chart.js — they're 10x faster to implement). d3's learning curve is steep.
Interactive web dashboards (use Plotly or Bokeh), real-time streaming charts, or when you just want something beautiful fast (try seaborn first).
d3
matplotlib