12
12
# http://matplotlib.org/examples/api/sankey_demo_old.html
13
13
# Modifications by Kevin Davies (kld@alumni.carnegiemellon.edu) 6/3/2011:
14
14
# --Used arcs for the curves (so that the widths of the paths are uniform)
15
- # --Converted the function to a class and created methods to join
16
- # multiple simple Sankey diagrams
15
+ # --Converted the function to a class and created methods to join multiple
16
+ # simple Sankey diagrams
17
17
# --Provided handling for cases where the total of the inputs isn't 100
18
18
# Now, the default layout is based on the assumption that the inputs sum to
19
19
# 1. A scaling parameter can be used in other cases.
29
29
# inputs/outputs are now specified via an orientation of 0, and there may
30
30
# be several of each.
31
31
# --Added assertions to catch common calling errors
32
- # -Added the physical unit as a string argument to be used in the labels, so
32
+ # - -Added the physical unit as a string argument to be used in the labels, so
33
33
# that the values of the flows can usually be applied automatically
34
34
# --Added an argument for a minimum magnitude below which flows are not shown
35
35
# --Added a tapered trunk in the case that the flows do not sum to 0
@@ -395,10 +395,10 @@ def add(self, patchlabel='', flows=None, orientations=None, labels='',
395
395
*orientations* == 0, inputs will break in from the
396
396
left and outputs will break away to the right.
397
397
*labels* list of specifications of the labels for the flows
398
- Each value may be None (no labels), '' (just label
399
- the quantities), or a labeling string. If a single
400
- value is provided, it will be applied to all flows.
401
- If an entry is a non-empty string, then the
398
+ Each value may be * None* (no labels), '' (just
399
+ label the quantities), or a labeling string. If a
400
+ single value is provided, it will be applied to all
401
+ flows. If an entry is a non-empty string, then the
402
402
quantity for the corresponding flow will be shown
403
403
below the string. However, if the *unit* of the
404
404
main diagram is None, then quantities are never
@@ -417,7 +417,7 @@ def add(self, patchlabel='', flows=None, orientations=None, labels='',
417
417
*connect* a (prior, this) tuple indexing the flow of the
418
418
prior diagram and the flow of this diagram which
419
419
should be connected
420
- If this is the first diagram or *prior* is None,
420
+ If this is the first diagram or *prior* is * None* ,
421
421
*connect* will be ignored.
422
422
*rotation* angle of rotation of the diagram [deg]
423
423
*rotation* is ignored if this diagram is connected
@@ -460,7 +460,7 @@ def add(self, patchlabel='', flows=None, orientations=None, labels='',
460
460
if rotation is None :
461
461
rotation = 0
462
462
else :
463
- # In the code below, angles are expressed in deg/90
463
+ # In the code below, angles are expressed in deg/90.
464
464
rotation /= 90.0
465
465
if orientations is None :
466
466
orientations = [0 , 0 ]
@@ -741,10 +741,10 @@ def _get_angle(a, r):
741
741
kwds = dict (s = patchlabel , ha = 'center' , va = 'center' )
742
742
text = self .ax .text (* offset , ** kwds )
743
743
if False : # Debug
744
- print "llpath\n " , llpath
745
- print "ulpath\n " , self ._revert (ulpath )
746
- print "urpath\n " , urpath
747
- print "lrpath\n " , self ._revert (lrpath )
744
+ print ( "llpath\n " , llpath )
745
+ print ( "ulpath\n " , self ._revert (ulpath ) )
746
+ print ( "urpath\n " , urpath )
747
+ print ( "lrpath\n " , self ._revert (lrpath ) )
748
748
xs , ys = zip (* vertices )
749
749
self .ax .plot (xs , ys , 'go-' )
750
750
patch = PathPatch (Path (vertices , codes ),
@@ -816,7 +816,7 @@ def finish(self):
816
816
(DOWN), and an output from the top side will have
817
817
an angle of 1 (UP). If a flow has been skipped
818
818
(because its magnitude is less than *tolerance*),
819
- then its angle will be None.
819
+ then its angle will be * None* .
820
820
*tips* array in which each row is an [x, y] pair
821
821
indicating the positions of the tips (or "dips") of
822
822
the flow paths
0 commit comments