ggplot2 vs Matplotlib
A data-driven comparison of two data visualization tools: popularity, development activity, licensing and installation. Updated .
A plotting system based on the grammar of graphics.
2D plotting library.
Key differences
- Matplotlib has 3.3× as many GitHub stars as ggplot2 (23.3K vs 7K).
- Matplotlib had more development activity over the last 12 months: 2,023 commits vs 86.
- ggplot2 is licensed under MIT; Matplotlib under PSF-2.0.
- ggplot2 is written primarily in R, Matplotlib in Python.
- ggplot2 is the older project: its repository was created in 2008, Matplotlib's in 2011.
By the numbers
- ggplot2
- Matplotlib
Show data as a table
| Metric | ggplot2 | Matplotlib |
|---|---|---|
| GitHub stars | 7,005 | 23,323 |
| Commits, last 12 months | 86 | 2,023 |
| Contributors | 354 | 438 |
| Forks | 2,125 | 8,503 |
Development activity
Commits per month to each default branch, last 12 complete months.
- ggplot2
- Matplotlib
Show data as a table
| Month | ggplot2 | Matplotlib |
|---|---|---|
| Oct 2025 | 29 | 100 |
| Nov 2025 | 12 | 72 |
| Dec 2025 | 20 | 97 |
| Jan 2026 | 1 | 153 |
| Feb 2026 | 4 | 144 |
| Mar 2026 | 2 | 244 |
| Apr 2026 | 4 | 197 |
| May 2026 | 0 | 257 |
| Jun 2026 | 0 | 257 |
| Jul 2026 | 0 | 199 |
| Aug 2026 | 0 | 139 |
| Sep 2026 | 14 | 164 |
Side by side
| Attribute | ggplot2 | Matplotlib |
|---|---|---|
| Description | A plotting system based on the grammar of graphics. | 2D plotting library. |
| Category | R data visualization packages | Python data visualization libraries |
| License | MIT | PSF-2.0 |
| Language | R | Python |
| Status | Active | Active |
| Latest release | v4.0.3 () | v3.11.2 () |
| Last commit | ||
| Repository created | ||
| Open issues | 76 | 1,059 |
| Install | install.packages("ggplot2") | pip install matplotlib |
Which should you choose?
Popularity and activity are only part of the story. Consider which ecosystem you work in, the chart types and interactions you need, how much data you render, and whether the license fits your project. Both tool pages list alternatives if neither is quite right.
-
ggplot2
A plotting system based on the grammar of graphics.
-
Matplotlib
2D plotting library.