pystreamgraph
A compact Matplotlib streamgraph helper, partially vibe-coded, with a lot of options for layout, smoothing, label placement etc.
Install
pip install pystreamgraph
Install from GitHub (no PyPI name needed)
pip install git+https://github.com/MNoichl/pystreamgraph.git
Quickstart
import numpy as np
import matplotlib.pyplot as plt
from pystreamgraph import plot_streamgraph
rng = np.random.default_rng(7)
n, k = 40, 5
X = np.arange(n)
base = np.linspace(0, 2*np.pi, n)
Y = []
for i in range(k):
phase = rng.uniform(0, 2*np.pi)
amp = rng.uniform(0.6, 1.3)
y = amp * (np.sin(base + phase) + 1.2) + rng.normal(0, 0.08, size=n) + 0.15
y = np.clip(y, 0, None)
Y.append(y)
Y = np.vstack(Y)
ax = plot_streamgraph(X, Y, labels=list("ABCDE"), sorted_streams=True,
margin_frac=0.10, smooth_window=1, cmap=None,
curve_samples=16, curve_method="pchip")
ax.set_title("Streamgraph with PCHIP boundaries")
plt.show()
Links
- Docs: https://MNoichl.github.io/pystreamgraph/
- Source: https://github.com/MNoichl/pystreamgraph
- Issues: https://github.com/MNoichl/pystreamgraph/issues
API
plot_streamgraph(X, Y, ...)– plot a streamgraph onto a Matplotlib Axes.streamgraph_envelopes(Y, ...)– compute bottoms/tops per layer.pchip_interpolate(x, y, ...)– shape‑preserving cubic interpolation.catmull_rom_interpolate(x, y, ...)– Catmull–Rom curve interpolation.
Metadata
Release files for pystreamgraph 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pystreamgraph-0.1.4.tar.gz | 2.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pystreamgraph-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.6 kB
Release files / pystreamgraph-0.1.4.tar.gz
| Download URL | pystreamgraph-0.1.4.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3473c15af3c0a31cdb776a0546ee10e9d141a164c7d42cca7ac1d385784ec727
|
|
BLAKE2b-256 checksum How to use checksums |
08e892d2e1fb368e06c57180030f774677f53a566ace390138e7aaa09e3c2727
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / pystreamgraph-0.1.4-py3-none-any.whl
| Download URL | pystreamgraph-0.1.4-py3-none-any.whl |
|---|---|
| Size | 23.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2cf9a292dafe6124ab738db15883f62c6fbe8c6ff905316e0ff9a77622b6c91b
|
|
BLAKE2b-256 checksum How to use checksums |
b3cd84cc2bb295649e989fea110c85af7c4341d04918cfae787d0017f385df64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|