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)
| 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 |