MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / Sankey

Class Sankey

lib/matplotlib/sankey.py:30–814  ·  view source on GitHub ↗

Sankey diagram. Sankey diagrams are a specific type of flow diagram, in which the width of the arrows is shown proportionally to the flow quantity. They are typically used to visualize energy or material or cost transfers between processes. `Wikipedia (6/1/2011)

Source from the content-addressed store, hash-verified

28
29
30class Sankey:
31 """
32 Sankey diagram.
33
34 Sankey diagrams are a specific type of flow diagram, in which
35 the width of the arrows is shown proportionally to the flow
36 quantity. They are typically used to visualize energy or
37 material or cost transfers between processes.
38 `Wikipedia (6/1/2011) <https://en.wikipedia.org/wiki/Sankey_diagram>`_
39
40 """
41
42 def __init__(self, ax=None, scale=1.0, unit='', format='%G', gap=0.25,
43 radius=0.1, shoulder=0.03, offset=0.15, head_angle=100,
44 margin=0.4, tolerance=1e-6, **kwargs):
45 """
46 Create a new Sankey instance.
47
48 The optional arguments listed below are applied to all subdiagrams so
49 that there is consistent alignment and formatting.
50
51 In order to draw a complex Sankey diagram, create an instance of
52 `Sankey` by calling it without any kwargs::
53
54 sankey = Sankey()
55
56 Then add simple Sankey sub-diagrams::
57
58 sankey.add() # 1
59 sankey.add() # 2
60 #...
61 sankey.add() # n
62
63 Finally, create the full diagram::
64
65 sankey.finish()
66
67 Or, instead, simply daisy-chain those calls::
68
69 Sankey().add().add... .add().finish()
70
71 Other Parameters
72 ----------------
73 ax : `~matplotlib.axes.Axes`
74 Axes onto which the data should be plotted. If *ax* isn&#x27;t
75 provided, new Axes will be created.
76 scale : float
77 Scaling factor for the flows. *scale* sizes the width of the paths
78 in order to maintain proper layout. The same scale is applied to
79 all subdiagrams. The value should be chosen such that the product
80 of the scale and the sum of the inputs is approximately 1.0 (and
81 the product of the scale and the sum of the outputs is
82 approximately -1.0).
83 unit : str
84 The physical unit associated with the flow quantities. If *unit*
85 is None, then none of the quantities are labeled.
86 format : str or callable
87 A Python number formatting string or callable used to label the

Callers 10

test_sankeyFunction · 0.90
test_labelFunction · 0.90
test_sankey_errorsFunction · 0.90
test_sankey_add_errorsFunction · 0.90
test_sankey2Function · 0.90
test_sankey3Function · 0.90
sankey_rankine.pyFile · 0.90
sankey_links.pyFile · 0.90
sankey_basics.pyFile · 0.90

Calls

no outgoing calls

Tested by 7

test_sankeyFunction · 0.72
test_labelFunction · 0.72
test_sankey_errorsFunction · 0.72
test_sankey_add_errorsFunction · 0.72
test_sankey2Function · 0.72
test_sankey3Function · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…