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

Method add

lib/matplotlib/sankey.py:351–776  ·  view source on GitHub ↗

Add a simple Sankey diagram with flows at the same hierarchical level. Parameters ---------- patchlabel : str Label to be placed at the center of the diagram. Note that *label* (not *patchlabel*) can be passed as keyword argument

(self, patchlabel='', flows=None, orientations=None, labels='',
            trunklength=1.0, pathlengths=0.25, prior=None, connect=(0, 0),
            rotation=0, **kwargs)

Source from the content-addressed store, hash-verified

349
350 @_docstring.interpd
351 def add(self, patchlabel='', flows=None, orientations=None, labels='',
352 trunklength=1.0, pathlengths=0.25, prior=None, connect=(0, 0),
353 rotation=0, **kwargs):
354 """
355 Add a simple Sankey diagram with flows at the same hierarchical level.
356
357 Parameters
358 ----------
359 patchlabel : str
360 Label to be placed at the center of the diagram.
361 Note that *label* (not *patchlabel*) can be passed as keyword
362 argument to create an entry in the legend.
363
364 flows : list of float
365 Array of flow values. By convention, inputs are positive and
366 outputs are negative.
367
368 Flows are placed along the top of the diagram from the inside out
369 in order of their index within *flows*. They are placed along the
370 sides of the diagram from the top down and along the bottom from
371 the outside in.
372
373 If the sum of the inputs and outputs is
374 nonzero, the discrepancy will appear as a cubic Bézier curve along
375 the top and bottom edges of the trunk.
376
377 orientations : list of {-1, 0, 1}
378 List of orientations of the flows (or a single orientation to be
379 used for all flows). Valid values are 0 (inputs from
380 the left, outputs to the right), 1 (from and to the top) or -1
381 (from and to the bottom).
382
383 labels : list of (str or None)
384 List of labels for the flows (or a single label to be used for all
385 flows). Each label may be *None* (no label), or a labeling string.
386 If an entry is a (possibly empty) string, then the quantity for the
387 corresponding flow will be shown below the string. However, if
388 the *unit* of the main diagram is None, then quantities are never
389 shown, regardless of the value of this argument.
390
391 trunklength : float
392 Length between the bases of the input and output groups (in
393 data-space units).
394
395 pathlengths : list of float
396 List of lengths of the vertical arrows before break-in or after
397 break-away. If a single value is given, then it will be applied to
398 the first (inside) paths on the top and bottom, and the length of
399 all other arrows will be justified accordingly. The *pathlengths*
400 are not applied to the horizontal inputs and outputs.
401
402 prior : int
403 Index of the prior diagram to which this diagram should be
404 connected.
405
406 connect : (int, int)
407 A (prior, this) tuple indexing the flow of the prior diagram and
408 the flow of this diagram which should be connected. If this is the

Callers 15

__init__Method · 0.95
test_sankeyFunction · 0.95
test_sankey_add_errorsFunction · 0.95
test_sankey3Function · 0.95
_register_tool_classFunction · 0.45
_init_drawMethod · 0.45
_try_addFunction · 0.45
_handle_toggleMethod · 0.45
pressMethod · 0.45
on_key_pressMethod · 0.45
add_stateMethod · 0.45

Calls 15

_add_inputMethod · 0.95
_add_outputMethod · 0.95
_revertMethod · 0.95
Affine2DClass · 0.90
PathPatchClass · 0.90
PathClass · 0.90
rotate_degMethod · 0.80
translateMethod · 0.80
add_patchMethod · 0.80
minMethod · 0.80
maxMethod · 0.80
shapeMethod · 0.45

Tested by 3

test_sankeyFunction · 0.76
test_sankey_add_errorsFunction · 0.76
test_sankey3Function · 0.76