Sankey plot for matplotlib
Project description
matplotlib-sankey
Documentation | PyPI | Github repository | Codecov
Sankey plot for matplotlib
Installation
Install with pip:
pip install matplotlib-sankey
Install from source:
git clone https://github.com/harryhaller001/matplotlib-sankey
cd matplotlib-sankey
pip install .
Example
data = [
# (source index, target index, weight)
[(0, 2, 20), (0, 1, 10), (3, 4, 15), (3, 2, 10), (5, 1, 5), (5, 2, 50)],
[(2, 6, 40), (1, 6, 15), (2, 7, 40), (4, 6, 15)],
[(7, 8, 5), (7, 9, 5), (7, 10, 20), (7, 11, 10), (6, 11, 55), (6, 8, 15)],
]
fig, ax = plt.subplots(figsize=(10, 5))
fig.tight_layout()
sankey(
data=data,
cmap="tab20",
annotate_columns=True,
ax=ax,
spacing=0.03,
)
Development
python3.10 -m virtualenv venv
source venv/bin/activate
# Install dev dependencies
make install
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
matplotlib_sankey-0.3.1.tar.gz
(15.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file matplotlib_sankey-0.3.1.tar.gz.
File metadata
- Download URL: matplotlib_sankey-0.3.1.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
531221461479dcd1702c69d2d7220918de1e8eabf8873e11127804feec3f1020
|
|
| MD5 |
e79e48ae922742140b0a5add11ebcf0d
|
|
| BLAKE2b-256 |
b57763ecdc7e7c779b11dafb5b8bad1ef64660dc1be4c39b0b02d50ed7d20e9f
|
File details
Details for the file matplotlib_sankey-0.3.1-py3-none-any.whl.
File metadata
- Download URL: matplotlib_sankey-0.3.1-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a2eff526efd9bb7c36144d47f675e9584fac28e67abd391dcd4ac506463ff42
|
|
| MD5 |
a3a340e0326d525532caf0d8cc8ec9f1
|
|
| BLAKE2b-256 |
ced0e8ab6229a721b73d73b3c87d8cb4c6ff8aeb8610b7df2e3835454f69c83b
|