Python package for plotting alluvial diagrams with an arbitrary number of layers
Project description
pylluvial
A python library for creating alluvial diagrams with an arbitrary number of layers
Installation
Simply run the following
pip install pylluvial
or clone the repository
git clone git@github.com:dmalzl/pyalluvial.git
and run
cd pyluvial
pip install .
you should then be able to import the package as usual
Usage
A minimal usage example would be as follows
import pylluvial as pa
data = pa.generate_test_data(
[3, 4, 3, 2]
)
# by default labels are not shown
fig, ax = pa.alluvial(
x='timepoint',
stratum='module',
alluvium='nodename',
data=data,
palette='husl',
stratum_gap=2,
stratum_width=2
)
fig.set_figwidth(10)
fig.set_figheight(5)
fig.tight_layout()
# pass show_labels = True to get labelled plots
fig, ax = pa.alluvial(
x = 'timepoint',
stratum = 'module',
alluvium = 'nodename',
palette = 'husl',
data = data,
stratum_gap = 2,
stratum_width = 2,
show_labels = True
)
fig.set_figwidth(10)
fig.set_figheight(5)
fig.tight_layout()
# use hue to split strata by a given grouping variable
fig, ax = pa.alluvial(
x = 'timepoint',
stratum = 'module',
alluvium = 'nodename',
hue = 'signif',
palette = 'tab20',
data = data,
stratum_gap = 2,
stratum_width = 2,
show_labels = True
)
fig.set_figwidth(10)
fig.set_figheight(5)
fig.tight_layout()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pylluvial-1.1.0.tar.gz
(10.7 kB
view hashes)
Built Distribution
pylluvial-1.1.0-py3-none-any.whl
(11.6 kB
view hashes)
Close
Hashes for pylluvial-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 283b70782c860c3fb187a02e1720a0d2cbb39b926ac8e80b5d69cb0a878ef2f2 |
|
MD5 | f3acb699f3e7c46e589f6d6fcffd4763 |
|
BLAKE2b-256 | 6f8354a65640a6e7cf06fa342b6fbfbfdfad65661cb1c57774800852be92a267 |