Allotaxonograph¶
The two-panel matplotlib rank-rank map.
keyflux.viz.allotaxonograph.allotaxonograph(list1, list2, *, alpha=1.0 / 3.0, labels=None, top=30, bins=24, figsize=(12.0, 6.0), cmap='viridis')
¶
Draw a two-panel allotaxonograph of two ranked lists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
list1
|
RankedList
|
The first ranked list. |
required |
list2
|
RankedList
|
The second ranked list. |
required |
alpha
|
float
|
Rank-turbulence-divergence tuning parameter; annotated on the figure and used for the contribution panel. |
1.0 / 3.0
|
labels
|
tuple[str, str] | None
|
|
None
|
top
|
int
|
Number of top contributors to show in the right panel. |
30
|
bins
|
int
|
Number of bins per axis in the rank-rank histogram. |
24
|
figsize
|
tuple[float, float]
|
Figure size in inches. |
(12.0, 6.0)
|
cmap
|
str
|
Matplotlib colormap name for the histogram. |
'viridis'
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
Figure
|
class: |
Figure
|
calls |
|
Figure
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If either list is empty (propagated from :func: |
Contract
- Returns a Figure with exactly two axes.
- Inputs are never mutated.
- The histogram and the contribution bars come from the same
rtdcall, so the two panels are always consistent.
Examples:
>>> from keyflux.datasets import load_jkbren_example
>>> r1, r2 = load_jkbren_example()
>>> fig = allotaxonograph(r1, r2, alpha=1.0, labels=("A", "B"))
>>> type(fig).__name__
'Figure'
>>> len(fig.axes)
2