rustplotlib 4.0.0__tar.gz → 4.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rustplotlib-4.0.1/CLAUDE.md +112 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/Cargo.lock +1 -1
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/Cargo.toml +1 -1
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/PKG-INFO +27 -21
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/README.md +26 -20
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/ROADMAP.md +23 -42
- rustplotlib-4.0.1/benchmark_results.csv +13 -0
- rustplotlib-4.0.1/docs/superpowers/plans/2026-04-04-jupyter-and-event-foundation.md +920 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/pyproject.toml +1 -1
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/figure.rs +32 -27
- rustplotlib-4.0.1/tests/test_benchmark.py +309 -0
- rustplotlib-4.0.1/tests/test_jupyter_repr.py +15 -0
- rustplotlib-4.0.0/tests/test_benchmark.py +0 -123
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/.github/workflows/ci.yml +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/.gitignore +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/CONTRIBUTING.md +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/LICENSE +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/dados/Data/PerfisTemp_rustplotlib.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/__init__.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/animation.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/axes/__init__.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/backends/__init__.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/backends/backend_inline.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/backends/backend_pdf.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/cm.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/collections.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/colors.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/cycler.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/dates.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/figure.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/font_manager.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/gridspec.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/lines.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/mpl_toolkits/__init__.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/mpl_toolkits/mplot3d/__init__.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/patches.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/patheffects.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/pyplot.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/pyplot.pyi +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/spines.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/style/__init__.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/text.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/ticker.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/transforms.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/python/rustplotlib/widgets.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/arrow.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/bar.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/bar3d.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/barh.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/boxplot.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/broken_barh.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/contour.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/contour3d.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/errorbar.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/eventplot.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/fill_between.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/fill_betweenx.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/fill_polygon.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/hexbin.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/hist.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/image.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/legend.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/line2d.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/line3d.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/mod.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/patches.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/pcolormesh.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/pie.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/quiver.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/radar.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/sankey.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/scatter.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/scatter3d.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/stem.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/step.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/streamplot.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/surface3d.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/trisurf3d.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/violin.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/artists/wireframe3d.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/axes.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/axes3d.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/colors.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/fonts/DejaVuSans.ttf +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/lib.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/projection3d.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/svg_renderer.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/text.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/ticker.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/transforms.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/src/window.rs +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/tests/test_3d.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/tests/test_colors.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/tests/test_figure.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/tests/test_new_features.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/tests/test_new_features2.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/tests/test_phase6_7.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/tests/test_phase8.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/tests/test_phase9_features.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/tests/test_pyplot.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/tests/test_spectral_features.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/tests/test_ticker.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/tests/test_transforms.py +0 -0
- {rustplotlib-4.0.0 → rustplotlib-4.0.1}/tests/test_v3_features.py +0 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# RustPlotLib — Contexto para Agents
|
|
2
|
+
|
|
3
|
+
Reimplementação completa do matplotlib em Rust puro. Drop-in replacement via PyO3.
|
|
4
|
+
|
|
5
|
+
## Linguagem
|
|
6
|
+
|
|
7
|
+
- Sempre responder em português (pt-BR)
|
|
8
|
+
|
|
9
|
+
## Estado Atual — v4.0.0
|
|
10
|
+
|
|
11
|
+
- 40+ plot types 2D, 7 plot types 3D
|
|
12
|
+
- 70+ colormaps (35 base + 35 reversed)
|
|
13
|
+
- 21 módulos Python compatíveis com API matplotlib
|
|
14
|
+
- 267 testes passando
|
|
15
|
+
- Output: PNG (tiny-skia), SVG nativo, PDF, GIF, janela interativa
|
|
16
|
+
- Performance: até 30x mais rápido que matplotlib
|
|
17
|
+
- Zero blocos `unsafe` em todo o código Rust
|
|
18
|
+
|
|
19
|
+
## Estrutura do Projeto
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
src/ # Core Rust
|
|
23
|
+
├── lib.rs # Registro de módulos PyO3
|
|
24
|
+
├── figure.rs # Figure + bindings PyO3 (savefig, render)
|
|
25
|
+
├── axes.rs # Axes 2D (~1500 linhas)
|
|
26
|
+
├── axes3d.rs # Axes 3D
|
|
27
|
+
├── projection3d.rs # Câmera + projeção 3D
|
|
28
|
+
├── transforms.rs # Coordenadas de dados → pixels
|
|
29
|
+
├── colors.rs # Parse de cores (named, hex, RGB, RGBA)
|
|
30
|
+
├── text.rs # Renderização de texto (ab_glyph + DejaVu Sans)
|
|
31
|
+
├── ticker.rs # Cálculo automático de ticks
|
|
32
|
+
├── svg_renderer.rs # Output SVG nativo
|
|
33
|
+
├── window.rs # Janela interativa (winit + softbuffer)
|
|
34
|
+
└── artists/ # Um arquivo por tipo de gráfico (35 arquivos)
|
|
35
|
+
├── mod.rs # Trait Artist
|
|
36
|
+
├── line2d.rs, scatter.rs, bar.rs, hist.rs, image.rs, ...
|
|
37
|
+
└── legend.rs
|
|
38
|
+
|
|
39
|
+
python/rustplotlib/ # Camada Python
|
|
40
|
+
├── pyplot.py # API principal (drop-in matplotlib.pyplot)
|
|
41
|
+
├── style/ # Temas (dark_background, ggplot, seaborn, bmh, fivethirtyeight)
|
|
42
|
+
├── animation.py # FuncAnimation + GIF
|
|
43
|
+
├── ticker.py # 12 Formatters + 10 Locators funcionais
|
|
44
|
+
├── dates.py, colors.py, patches.py, ...
|
|
45
|
+
└── mpl_toolkits/mplot3d/ # Suporte 3D
|
|
46
|
+
|
|
47
|
+
tests/ # Testes Python (267 testes)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Stack Técnica
|
|
51
|
+
|
|
52
|
+
| Componente | Tecnologia |
|
|
53
|
+
|---|---|
|
|
54
|
+
| Renderização 2D | tiny-skia |
|
|
55
|
+
| Fontes | ab_glyph + DejaVu Sans embutida |
|
|
56
|
+
| PNG | crate png |
|
|
57
|
+
| SVG | Renderer customizado |
|
|
58
|
+
| Janela | winit + softbuffer |
|
|
59
|
+
| 3D | Projeção ortográfica customizada |
|
|
60
|
+
| Bindings Python | PyO3 + maturin |
|
|
61
|
+
| NumPy interop | crate numpy (PyO3) |
|
|
62
|
+
|
|
63
|
+
## Como Adicionar Features
|
|
64
|
+
|
|
65
|
+
### Novo tipo de gráfico (caminho completo):
|
|
66
|
+
1. `src/artists/novo_plot.rs` — implementar trait Artist (draw, data_bounds, legend_label, legend_color)
|
|
67
|
+
2. `src/artists/mod.rs` — registrar módulo
|
|
68
|
+
3. `src/axes.rs` — adicionar método no Axes
|
|
69
|
+
4. `src/figure.rs` — adicionar binding PyO3
|
|
70
|
+
5. `python/rustplotlib/pyplot.py` — wrapper Python (AxesProxy + função module-level)
|
|
71
|
+
6. `tests/test_*.py` — testes
|
|
72
|
+
7. `ROADMAP.md` — marcar checkbox `[x]`
|
|
73
|
+
8. `README.md` — atualizar tabela de features
|
|
74
|
+
|
|
75
|
+
### Feature simples (só Python):
|
|
76
|
+
Se pode ser construída em cima das funções Rust existentes, implementar direto em `pyplot.py`.
|
|
77
|
+
|
|
78
|
+
## Comandos de Desenvolvimento
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
cd /Users/thi4gon/Documents/workspace/matplot
|
|
82
|
+
source .venv/bin/activate
|
|
83
|
+
maturin develop # Build debug
|
|
84
|
+
maturin develop --release # Build release (benchmarks)
|
|
85
|
+
pytest tests/ -v # Rodar todos os testes
|
|
86
|
+
cargo check # Verificar compilação Rust
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Regras de Código
|
|
90
|
+
|
|
91
|
+
- **Zero `unsafe`** — sem exceção
|
|
92
|
+
- **Sem `.unwrap()` em input do usuário** — usar proper error handling
|
|
93
|
+
- **Validar inputs na fronteira PyO3** — path traversal, dimensões, tipos
|
|
94
|
+
- **Todo feature novo precisa de teste**
|
|
95
|
+
- **Manter compatibilidade com API do matplotlib** — mesmos nomes de funções e parâmetros
|
|
96
|
+
- **Atualizar ROADMAP.md e README.md** ao completar features
|
|
97
|
+
|
|
98
|
+
## Roadmap Ativo (próximo: v5.0.0)
|
|
99
|
+
|
|
100
|
+
Próximos itens prioritários (ver ROADMAP.md para lista completa):
|
|
101
|
+
|
|
102
|
+
1. **Jupyter inline backend** — rich display protocol, _repr_png_
|
|
103
|
+
2. **Backends interativos** — Qt, GTK, macOS native
|
|
104
|
+
3. **Widgets funcionais** — Slider, Button, CheckButtons com renderização real
|
|
105
|
+
4. **Features interativas** — mouse events, zoom/pan, rotação 3D
|
|
106
|
+
5. **Triangulation plots** — tricontour, tricontourf, tripcolor (atualmente stubs)
|
|
107
|
+
|
|
108
|
+
## Git
|
|
109
|
+
|
|
110
|
+
- Branch principal: `master`
|
|
111
|
+
- Repo: `https://github.com/Thi4gon/rustplotlib`
|
|
112
|
+
- Commits seguem conventional commits: `feat:`, `fix:`, `docs:`, `release:`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rustplotlib
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.1
|
|
4
4
|
Classifier: Development Status :: 3 - Alpha
|
|
5
5
|
Classifier: Intended Audience :: Science/Research
|
|
6
6
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -37,7 +37,7 @@ No Python runtime dependency for rendering. No wrappers. No subprocess calls. Pu
|
|
|
37
37
|
|---|---|---|---|
|
|
38
38
|
| Rendering engine | C/C++ (AGG) | None (wrap matplotlib or call Python) | **Rust native (tiny-skia)** |
|
|
39
39
|
| External dependencies | NumPy, Pillow, FreeType, etc. | Python + matplotlib required | **Zero** — self-contained |
|
|
40
|
-
| Performance | Baseline | Same or slower (subprocess overhead) | **Up to
|
|
40
|
+
| Performance | Baseline | Same or slower (subprocess overhead) | **Up to 16x faster** |
|
|
41
41
|
| Python API | Original | Rust-only or generates .py scripts | **Drop-in replacement** — same API |
|
|
42
42
|
| Approach | Interpreted + C extensions | Wrappers / code generators | **Full reimplementation in Rust** |
|
|
43
43
|
|
|
@@ -245,7 +245,7 @@ All also available as `viridis_r`, `plasma_r`, `hot_r`, etc.
|
|
|
245
245
|
- **Dates:** `date2num()`, `num2date()`, date formatters and locators
|
|
246
246
|
- **Categorical axes:** string-based x values automatically converted
|
|
247
247
|
|
|
248
|
-
### Compatibility Modules (
|
|
248
|
+
### Compatibility Modules (21 modules)
|
|
249
249
|
| Module | Status |
|
|
250
250
|
|---|---|
|
|
251
251
|
| `rustplotlib.pyplot` | Full implementation (50+ functions) |
|
|
@@ -253,10 +253,10 @@ All also available as `viridis_r`, `plasma_r`, `hot_r`, etc.
|
|
|
253
253
|
| `rustplotlib.animation` | FuncAnimation + GIF export |
|
|
254
254
|
| `rustplotlib.widgets` | Stubs (Slider, Button, CheckButtons, RadioButtons, TextBox, Cursor) |
|
|
255
255
|
| `rustplotlib.font_manager` | FontProperties |
|
|
256
|
-
| `rustplotlib.ticker` |
|
|
257
|
-
| `rustplotlib.patches` | Rectangle, Circle, Polygon, FancyBboxPatch, Wedge |
|
|
258
|
-
| `rustplotlib.colors` | LinearSegmentedColormap, Normalize, LogNorm |
|
|
259
|
-
| `rustplotlib.dates` | Date conversion,
|
|
256
|
+
| `rustplotlib.ticker` | 12 Formatters + 10 Locators (functional) |
|
|
257
|
+
| `rustplotlib.patches` | Rectangle, Circle, Polygon, FancyBboxPatch, Wedge, FancyArrowPatch |
|
|
258
|
+
| `rustplotlib.colors` | LinearSegmentedColormap, Normalize, LogNorm, BoundaryNorm |
|
|
259
|
+
| `rustplotlib.dates` | Date conversion, DateFormatter, DateLocator, Auto/Day/Month/Year/Hour/MinuteLocator |
|
|
260
260
|
| `rustplotlib.gridspec` | GridSpec, SubplotSpec |
|
|
261
261
|
| `rustplotlib.backends` | Backend system, PdfPages |
|
|
262
262
|
| `rustplotlib.mpl_toolkits.mplot3d` | Axes3D for 3D plotting |
|
|
@@ -267,7 +267,6 @@ All also available as `viridis_r`, `plasma_r`, `hot_r`, etc.
|
|
|
267
267
|
| `rustplotlib.transforms` | Bbox, Affine2D, BboxTransform |
|
|
268
268
|
| `rustplotlib.patheffects` | Stroke, withStroke, SimplePatchShadow |
|
|
269
269
|
| `rustplotlib.spines` | Spine |
|
|
270
|
-
| `rustplotlib.axes` | Axes class reference |
|
|
271
270
|
| `rustplotlib.figure` | Figure class reference |
|
|
272
271
|
| `rustplotlib.cycler` | cycler compatibility |
|
|
273
272
|
|
|
@@ -361,11 +360,18 @@ Benchmarked against matplotlib on Apple Silicon (M-series). Each test runs 10 it
|
|
|
361
360
|
|
|
362
361
|
| Benchmark | matplotlib | rustplotlib | Speedup |
|
|
363
362
|
|---|---|---|---|
|
|
364
|
-
| Line Plot (10k
|
|
365
|
-
| Scatter (5k
|
|
366
|
-
| Bar Chart (50 bars) | 0.
|
|
367
|
-
| Histogram (100k
|
|
368
|
-
| Subplots 2x2 | 0.
|
|
363
|
+
| Line Plot (10k pts) | 0.028s | 0.005s | **5.3x** |
|
|
364
|
+
| Scatter (5k pts) | 0.028s | 0.021s | **1.4x** |
|
|
365
|
+
| Bar Chart (50 bars) | 0.026s | 0.005s | **5.0x** |
|
|
366
|
+
| Histogram (100k pts) | 0.090s | 0.006s | **16.1x** |
|
|
367
|
+
| Subplots 2x2 | 0.046s | 0.011s | **4.2x** |
|
|
368
|
+
| Heatmap (100x100) | 0.021s | 0.006s | **3.4x** |
|
|
369
|
+
| Large Line (100k pts) | 0.110s | 0.109s | **1.0x** |
|
|
370
|
+
| Multi-line (20 lines) | 0.090s | 0.037s | **2.4x** |
|
|
371
|
+
| Error Bars | 0.022s | 0.004s | **6.4x** |
|
|
372
|
+
| Pie Chart | 0.012s | 0.005s | **2.7x** |
|
|
373
|
+
| SVG Output | 0.021s | 0.003s | **6.9x** |
|
|
374
|
+
| Full Styled Plot | 0.019s | 0.006s | **3.4x** |
|
|
369
375
|
|
|
370
376
|
Run the benchmark yourself:
|
|
371
377
|
```bash
|
|
@@ -440,22 +446,22 @@ Contributions are welcome! This is an open-source project under the MIT license.
|
|
|
440
446
|
4. PRs require at least 1 review before merging
|
|
441
447
|
|
|
442
448
|
**Project stats:**
|
|
443
|
-
- **45+ Rust source files** —
|
|
444
|
-
- **
|
|
449
|
+
- **45+ Rust source files** — 23,000+ lines of native code
|
|
450
|
+
- **21 Python modules** — 8,000+ lines of API
|
|
445
451
|
- **47+ plot functions** (40 2D + 7 3D)
|
|
446
452
|
- **70+ colormaps** (35 base + 35 reversed)
|
|
447
|
-
- **
|
|
448
|
-
- **
|
|
453
|
+
- **267 tests** passing
|
|
454
|
+
- **22 formatters + locators** (functional)
|
|
449
455
|
- **RGB/RGBA imshow**, bilinear interpolation, heatmap annotations
|
|
450
456
|
- **Signal processing**: specgram, psd, acorr, xcorr, coherence
|
|
451
457
|
- **Zero `unsafe` blocks**
|
|
452
458
|
|
|
453
459
|
**Priority areas for contribution:**
|
|
454
|
-
-
|
|
455
|
-
-
|
|
456
|
-
- Interactive
|
|
460
|
+
- Jupyter inline backend (rich display protocol)
|
|
461
|
+
- Functional widgets (Slider, Button, CheckButtons with real rendering)
|
|
462
|
+
- Interactive features (mouse events, zoom/pan, 3D rotation)
|
|
457
463
|
- Qt/GTK backends
|
|
458
|
-
-
|
|
464
|
+
- Triangulation plots (tricontour, tripcolor)
|
|
459
465
|
|
|
460
466
|
---
|
|
461
467
|
|
|
@@ -17,7 +17,7 @@ No Python runtime dependency for rendering. No wrappers. No subprocess calls. Pu
|
|
|
17
17
|
|---|---|---|---|
|
|
18
18
|
| Rendering engine | C/C++ (AGG) | None (wrap matplotlib or call Python) | **Rust native (tiny-skia)** |
|
|
19
19
|
| External dependencies | NumPy, Pillow, FreeType, etc. | Python + matplotlib required | **Zero** — self-contained |
|
|
20
|
-
| Performance | Baseline | Same or slower (subprocess overhead) | **Up to
|
|
20
|
+
| Performance | Baseline | Same or slower (subprocess overhead) | **Up to 16x faster** |
|
|
21
21
|
| Python API | Original | Rust-only or generates .py scripts | **Drop-in replacement** — same API |
|
|
22
22
|
| Approach | Interpreted + C extensions | Wrappers / code generators | **Full reimplementation in Rust** |
|
|
23
23
|
|
|
@@ -225,7 +225,7 @@ All also available as `viridis_r`, `plasma_r`, `hot_r`, etc.
|
|
|
225
225
|
- **Dates:** `date2num()`, `num2date()`, date formatters and locators
|
|
226
226
|
- **Categorical axes:** string-based x values automatically converted
|
|
227
227
|
|
|
228
|
-
### Compatibility Modules (
|
|
228
|
+
### Compatibility Modules (21 modules)
|
|
229
229
|
| Module | Status |
|
|
230
230
|
|---|---|
|
|
231
231
|
| `rustplotlib.pyplot` | Full implementation (50+ functions) |
|
|
@@ -233,10 +233,10 @@ All also available as `viridis_r`, `plasma_r`, `hot_r`, etc.
|
|
|
233
233
|
| `rustplotlib.animation` | FuncAnimation + GIF export |
|
|
234
234
|
| `rustplotlib.widgets` | Stubs (Slider, Button, CheckButtons, RadioButtons, TextBox, Cursor) |
|
|
235
235
|
| `rustplotlib.font_manager` | FontProperties |
|
|
236
|
-
| `rustplotlib.ticker` |
|
|
237
|
-
| `rustplotlib.patches` | Rectangle, Circle, Polygon, FancyBboxPatch, Wedge |
|
|
238
|
-
| `rustplotlib.colors` | LinearSegmentedColormap, Normalize, LogNorm |
|
|
239
|
-
| `rustplotlib.dates` | Date conversion,
|
|
236
|
+
| `rustplotlib.ticker` | 12 Formatters + 10 Locators (functional) |
|
|
237
|
+
| `rustplotlib.patches` | Rectangle, Circle, Polygon, FancyBboxPatch, Wedge, FancyArrowPatch |
|
|
238
|
+
| `rustplotlib.colors` | LinearSegmentedColormap, Normalize, LogNorm, BoundaryNorm |
|
|
239
|
+
| `rustplotlib.dates` | Date conversion, DateFormatter, DateLocator, Auto/Day/Month/Year/Hour/MinuteLocator |
|
|
240
240
|
| `rustplotlib.gridspec` | GridSpec, SubplotSpec |
|
|
241
241
|
| `rustplotlib.backends` | Backend system, PdfPages |
|
|
242
242
|
| `rustplotlib.mpl_toolkits.mplot3d` | Axes3D for 3D plotting |
|
|
@@ -247,7 +247,6 @@ All also available as `viridis_r`, `plasma_r`, `hot_r`, etc.
|
|
|
247
247
|
| `rustplotlib.transforms` | Bbox, Affine2D, BboxTransform |
|
|
248
248
|
| `rustplotlib.patheffects` | Stroke, withStroke, SimplePatchShadow |
|
|
249
249
|
| `rustplotlib.spines` | Spine |
|
|
250
|
-
| `rustplotlib.axes` | Axes class reference |
|
|
251
250
|
| `rustplotlib.figure` | Figure class reference |
|
|
252
251
|
| `rustplotlib.cycler` | cycler compatibility |
|
|
253
252
|
|
|
@@ -341,11 +340,18 @@ Benchmarked against matplotlib on Apple Silicon (M-series). Each test runs 10 it
|
|
|
341
340
|
|
|
342
341
|
| Benchmark | matplotlib | rustplotlib | Speedup |
|
|
343
342
|
|---|---|---|---|
|
|
344
|
-
| Line Plot (10k
|
|
345
|
-
| Scatter (5k
|
|
346
|
-
| Bar Chart (50 bars) | 0.
|
|
347
|
-
| Histogram (100k
|
|
348
|
-
| Subplots 2x2 | 0.
|
|
343
|
+
| Line Plot (10k pts) | 0.028s | 0.005s | **5.3x** |
|
|
344
|
+
| Scatter (5k pts) | 0.028s | 0.021s | **1.4x** |
|
|
345
|
+
| Bar Chart (50 bars) | 0.026s | 0.005s | **5.0x** |
|
|
346
|
+
| Histogram (100k pts) | 0.090s | 0.006s | **16.1x** |
|
|
347
|
+
| Subplots 2x2 | 0.046s | 0.011s | **4.2x** |
|
|
348
|
+
| Heatmap (100x100) | 0.021s | 0.006s | **3.4x** |
|
|
349
|
+
| Large Line (100k pts) | 0.110s | 0.109s | **1.0x** |
|
|
350
|
+
| Multi-line (20 lines) | 0.090s | 0.037s | **2.4x** |
|
|
351
|
+
| Error Bars | 0.022s | 0.004s | **6.4x** |
|
|
352
|
+
| Pie Chart | 0.012s | 0.005s | **2.7x** |
|
|
353
|
+
| SVG Output | 0.021s | 0.003s | **6.9x** |
|
|
354
|
+
| Full Styled Plot | 0.019s | 0.006s | **3.4x** |
|
|
349
355
|
|
|
350
356
|
Run the benchmark yourself:
|
|
351
357
|
```bash
|
|
@@ -420,22 +426,22 @@ Contributions are welcome! This is an open-source project under the MIT license.
|
|
|
420
426
|
4. PRs require at least 1 review before merging
|
|
421
427
|
|
|
422
428
|
**Project stats:**
|
|
423
|
-
- **45+ Rust source files** —
|
|
424
|
-
- **
|
|
429
|
+
- **45+ Rust source files** — 23,000+ lines of native code
|
|
430
|
+
- **21 Python modules** — 8,000+ lines of API
|
|
425
431
|
- **47+ plot functions** (40 2D + 7 3D)
|
|
426
432
|
- **70+ colormaps** (35 base + 35 reversed)
|
|
427
|
-
- **
|
|
428
|
-
- **
|
|
433
|
+
- **267 tests** passing
|
|
434
|
+
- **22 formatters + locators** (functional)
|
|
429
435
|
- **RGB/RGBA imshow**, bilinear interpolation, heatmap annotations
|
|
430
436
|
- **Signal processing**: specgram, psd, acorr, xcorr, coherence
|
|
431
437
|
- **Zero `unsafe` blocks**
|
|
432
438
|
|
|
433
439
|
**Priority areas for contribution:**
|
|
434
|
-
-
|
|
435
|
-
-
|
|
436
|
-
- Interactive
|
|
440
|
+
- Jupyter inline backend (rich display protocol)
|
|
441
|
+
- Functional widgets (Slider, Button, CheckButtons with real rendering)
|
|
442
|
+
- Interactive features (mouse events, zoom/pan, 3D rotation)
|
|
437
443
|
- Qt/GTK backends
|
|
438
|
-
-
|
|
444
|
+
- Triangulation plots (tricontour, tripcolor)
|
|
439
445
|
|
|
440
446
|
---
|
|
441
447
|
|
|
@@ -4,7 +4,7 @@ Goal: Full matplotlib reimplementation in Rust.
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
## DONE —
|
|
7
|
+
## DONE — v4.0.0
|
|
8
8
|
|
|
9
9
|
### 2D Plot Types (40+ implemented)
|
|
10
10
|
- [x] plot, scatter, bar, barh, hist, imshow (RGB/RGBA + bilinear), fill_between, fill_betweenx, fill
|
|
@@ -30,8 +30,16 @@ Goal: Full matplotlib reimplementation in Rust.
|
|
|
30
30
|
- [x] 6 style themes, 70+ colormaps (+ reversed), custom fonts, rcParams (30+ keys)
|
|
31
31
|
- [x] Bilinear interpolation, title loc, multi-group plot, image extent, RGB/RGBA imshow
|
|
32
32
|
- [x] Aspect ratio, invert axes, axis off, subplot_mosaic, suptitle, subplots_adjust
|
|
33
|
-
- [x] Minor ticks
|
|
34
|
-
- [x]
|
|
33
|
+
- [x] Minor ticks rendering + `set_xticks(minor=True)` functional
|
|
34
|
+
- [x] Label colors, get_xlim/get_ylim (functional), axes clear
|
|
35
|
+
- [x] Image origin ('upper' / 'lower')
|
|
36
|
+
|
|
37
|
+
### Formatters & Locators (22 implemented)
|
|
38
|
+
- [x] ScalarFormatter, LogFormatter, LogFormatterSciNotation, LogFormatterMathtext
|
|
39
|
+
- [x] EngFormatter, PercentFormatter, StrMethodFormatter, FuncFormatter, FormatStrFormatter
|
|
40
|
+
- [x] MaxNLocator, AutoLocator, MultipleLocator, LogLocator, FixedLocator, AutoMinorLocator
|
|
41
|
+
- [x] DateFormatter, AutoDateFormatter, DateLocator, AutoDateLocator
|
|
42
|
+
- [x] DayLocator, MonthLocator, YearLocator, HourLocator, MinuteLocator
|
|
35
43
|
|
|
36
44
|
### Compatibility Modules (23)
|
|
37
45
|
- [x] pyplot (50+ functions), style, animation, widgets, font_manager, ticker, patches, colors
|
|
@@ -46,49 +54,22 @@ Goal: Full matplotlib reimplementation in Rust.
|
|
|
46
54
|
|
|
47
55
|
---
|
|
48
56
|
|
|
49
|
-
##
|
|
57
|
+
## PLANNED — v5.0.0
|
|
50
58
|
|
|
51
59
|
### Remaining Plot Types
|
|
52
|
-
- [ ] `
|
|
53
|
-
- [ ] `
|
|
54
|
-
- [ ] `stairs()` — step plot with edges
|
|
55
|
-
- [ ] `tricontour()` / `tricontourf()` — contour on triangulation
|
|
56
|
-
- [ ] `tripcolor()` — pseudocolor on triangulation
|
|
57
|
-
- [ ] `triplot()` — plot triangulation edges
|
|
58
|
-
|
|
59
|
-
### Formatters & Locators (functional, not stubs)
|
|
60
|
-
- [ ] `ScalarFormatter` — default number formatting
|
|
61
|
-
- [ ] `LogFormatter` / `LogFormatterSciNotation`
|
|
62
|
-
- [ ] `EngFormatter` — engineering notation (1k, 1M, 1G)
|
|
63
|
-
- [ ] `PercentFormatter`
|
|
64
|
-
- [ ] `StrMethodFormatter` / `FuncFormatter`
|
|
65
|
-
- [ ] `MaxNLocator` — smart tick placement (partial, have auto_ticks)
|
|
66
|
-
- [ ] `MultipleLocator` — ticks at multiples
|
|
67
|
-
- [ ] `LogLocator` — logarithmic ticks
|
|
68
|
-
- [ ] `FixedLocator` — user-specified positions
|
|
69
|
-
- [ ] `AutoMinorLocator` — automatic minor ticks
|
|
70
|
-
- [ ] `DateFormatter` functional (format ticks as dates)
|
|
71
|
-
- [ ] `DateLocator` functional (place ticks at date intervals)
|
|
60
|
+
- [ ] `tricontour()` / `tricontourf()` — contour on triangulation (currently stubs)
|
|
61
|
+
- [ ] `tripcolor()` — pseudocolor on triangulation (currently stub)
|
|
72
62
|
|
|
73
63
|
### Advanced Customization
|
|
74
|
-
- [ ] `FancyArrowPatch` — complex arrow styles (arc, angle, etc.)
|
|
75
|
-
- [ ] `ConnectionPatch` — arrows connecting different axes
|
|
64
|
+
- [ ] `FancyArrowPatch` — complex arrow styles (arc, angle, etc.) — currently basic stub
|
|
65
|
+
- [ ] `ConnectionPatch` — arrows connecting different axes — currently basic stub
|
|
76
66
|
- [ ] Spine positioning (`set_position('center')`, `set_position(('data', 0))`)
|
|
77
|
-
- [ ] Minor ticks rendering (major/minor tick distinction)
|
|
78
67
|
- [ ] Grid major/minor separate styling
|
|
79
|
-
- [ ] `ax.set_xticks(minor=True)` functional
|
|
80
68
|
- [ ] Colorbar as separate Axes (not inline drawing)
|
|
81
|
-
- [ ] `TwoSlopeNorm`, `CenteredNorm
|
|
69
|
+
- [ ] `TwoSlopeNorm`, `CenteredNorm` functional
|
|
82
70
|
|
|
83
71
|
### Image Improvements
|
|
84
72
|
- [ ] Bicubic, Lanczos, Spline interpolation
|
|
85
|
-
- [ ] Image origin ('upper' vs 'lower')
|
|
86
|
-
- [ ] Image extent parameter
|
|
87
|
-
- [ ] RGB/RGBA image support in imshow
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
## PLANNED — v4.0.0
|
|
92
73
|
|
|
93
74
|
### Functional Backends
|
|
94
75
|
- [ ] Qt backend (QApplication, mouse events, toolbar, save dialog)
|
|
@@ -117,7 +98,7 @@ Goal: Full matplotlib reimplementation in Rust.
|
|
|
117
98
|
|
|
118
99
|
---
|
|
119
100
|
|
|
120
|
-
## PLANNED —
|
|
101
|
+
## PLANNED — v6.0.0
|
|
121
102
|
|
|
122
103
|
### Full LaTeX Math Rendering
|
|
123
104
|
- [ ] TeX layout engine (fractions, roots, integrals, summation)
|
|
@@ -146,7 +127,7 @@ Goal: Full matplotlib reimplementation in Rust.
|
|
|
146
127
|
|
|
147
128
|
---
|
|
148
129
|
|
|
149
|
-
## PLANNED —
|
|
130
|
+
## PLANNED — v7.0.0
|
|
150
131
|
|
|
151
132
|
### Geographic/Specialized Projections
|
|
152
133
|
- [ ] Polar projection improvements (theta direction, offset)
|
|
@@ -184,7 +165,7 @@ Goal: Full matplotlib reimplementation in Rust.
|
|
|
184
165
|
Pick any unchecked item, open an issue to discuss, submit a PR with tests.
|
|
185
166
|
|
|
186
167
|
**Highest impact areas:**
|
|
187
|
-
1.
|
|
188
|
-
2.
|
|
189
|
-
3. LaTeX rendering (
|
|
190
|
-
4.
|
|
168
|
+
1. Jupyter backend (v5.0.0) — huge for data scientists
|
|
169
|
+
2. Interactive features (v5.0.0) — needed for exploratory analysis
|
|
170
|
+
3. LaTeX rendering (v6.0.0) — needed for scientific papers
|
|
171
|
+
4. Triangulation plots (v5.0.0) — tricontour, tripcolor
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
benchmark,matplotlib_s,rustplotlib_s,speedup
|
|
2
|
+
Line Plot (10k pts),0.028050,0.005270,5.32
|
|
3
|
+
Scatter (5k pts),0.028230,0.020534,1.37
|
|
4
|
+
Bar Chart (50 bars),0.025549,0.005095,5.01
|
|
5
|
+
Histogram (100k pts),0.090139,0.005606,16.08
|
|
6
|
+
Subplots 2x2,0.046219,0.010970,4.21
|
|
7
|
+
Heatmap (100x100),0.020790,0.006080,3.42
|
|
8
|
+
Large Line (100k pts),0.109854,0.109353,1.00
|
|
9
|
+
Multi-line (20 lines),0.090231,0.037224,2.42
|
|
10
|
+
Error Bars,0.022393,0.003487,6.42
|
|
11
|
+
Pie Chart,0.012209,0.004486,2.72
|
|
12
|
+
SVG Output,0.020507,0.002972,6.90
|
|
13
|
+
Full Styled Plot,0.018751,0.005461,3.43
|