Skip to main content

Sankey plot for matplotlib

Project description

matplotlib-sankey

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,
)

Sankey plot example

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.2.1.tar.gz (174.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

matplotlib_sankey-0.2.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file matplotlib_sankey-0.2.1.tar.gz.

File metadata

  • Download URL: matplotlib_sankey-0.2.1.tar.gz
  • Upload date:
  • Size: 174.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for matplotlib_sankey-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7bfac701100fed2d2cafffd78e8ce1faae77a0e48e96610ed0bc9e381f7a6d85
MD5 e158fbccd3702ccfaa747c074eb1d9ce
BLAKE2b-256 77ccf4fa3298aeda93a388c7a45c7c5c8b3d3446e192e12cfca8ac5f2434947c

See more details on using hashes here.

File details

Details for the file matplotlib_sankey-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for matplotlib_sankey-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 94e32dca6a37f22ce36813ec71547f5ed9adc6ceb4b9e3204ad1b01d4675aece
MD5 2556302cc902b1fae5f9d639502dc5c9
BLAKE2b-256 b313af2bc0731a553ab7a017ef2e42730c10bc94713056480ba7d96b0899819a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page