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

Method __init__

lib/matplotlib/sankey.py:42–167  ·  view source on GitHub ↗

Create a new Sankey instance. The optional arguments listed below are applied to all subdiagrams so that there is consistent alignment and formatting. In order to draw a complex Sankey diagram, create an instance of `Sankey` by calling it without any kwargs

(self, ax=None, scale=1.0, unit='', format='%G', gap=0.25,
                 radius=0.1, shoulder=0.03, offset=0.15, head_angle=100,
                 margin=0.4, tolerance=1e-6, **kwargs)

Source from the content-addressed store, hash-verified

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'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
88 flows with their quantities (i.e., a number times a unit, where the
89 unit is given). If a format string is given, the label will be
90 ``format % quantity``. If a callable is given, it will be called
91 with ``quantity`` as an argument.
92 gap : float
93 Space between paths that break in/break away to/from the top or
94 bottom.
95 radius : float
96 Inner radius of the vertical paths.
97 shoulder : float
98 Size of the shoulders of output arrows.
99 offset : float

Callers

nothing calls this directly

Calls 3

addMethod · 0.95
figureMethod · 0.80
add_subplotMethod · 0.80

Tested by

no test coverage detected