|
13 | 13 |
|
14 | 14 | ###############################################################################
|
15 | 15 | # Example 1 -- Mostly defaults
|
| 16 | +# |
16 | 17 | # This demonstrates how to create a simple diagram by implicitly calling the
|
17 | 18 | # Sankey.add() method and by appending finish() to the call to the class.
|
18 | 19 |
|
|
23 | 24 |
|
24 | 25 | ###############################################################################
|
25 | 26 | # Notice:
|
26 |
| -# 1. Axes weren't provided when Sankey() was instantiated, so they were |
27 |
| -# created automatically. |
28 |
| -# 2. The scale argument wasn't necessary since the data was already |
29 |
| -# normalized. |
30 |
| -# 3. By default, the lengths of the paths are justified. |
| 27 | +# |
| 28 | +# 1. Axes weren't provided when Sankey() was instantiated, so they were |
| 29 | +# created automatically. |
| 30 | +# 2. The scale argument wasn't necessary since the data was already |
| 31 | +# normalized. |
| 32 | +# 3. By default, the lengths of the paths are justified. |
| 33 | + |
31 | 34 |
|
32 | 35 | ###############################################################################
|
33 | 36 | # Example 2
|
| 37 | +# |
34 | 38 | # This demonstrates:
|
35 |
| -# 1. Setting one path longer than the others |
36 |
| -# 2. Placing a label in the middle of the diagram |
37 |
| -# 3. Using the scale argument to normalize the flows |
38 |
| -# 4. Implicitly passing keyword arguments to PathPatch() |
39 |
| -# 5. Changing the angle of the arrow heads |
40 |
| -# 6. Changing the offset between the tips of the paths and their labels |
41 |
| -# 7. Formatting the numbers in the path labels and the associated unit |
42 |
| -# 8. Changing the appearance of the patch and the labels after the figure is |
43 |
| -# created |
| 39 | +# |
| 40 | +# 1. Setting one path longer than the others |
| 41 | +# 2. Placing a label in the middle of the diagram |
| 42 | +# 3. Using the scale argument to normalize the flows |
| 43 | +# 4. Implicitly passing keyword arguments to PathPatch() |
| 44 | +# 5. Changing the angle of the arrow heads |
| 45 | +# 6. Changing the offset between the tips of the paths and their labels |
| 46 | +# 7. Formatting the numbers in the path labels and the associated unit |
| 47 | +# 8. Changing the appearance of the patch and the labels after the figure is |
| 48 | +# created |
44 | 49 |
|
45 | 50 | fig = plt.figure()
|
46 | 51 | ax = fig.add_subplot(1, 1, 1, xticks=[], yticks=[],
|
|
60 | 65 |
|
61 | 66 | ###############################################################################
|
62 | 67 | # Notice:
|
63 |
| -# 1. Since the sum of the flows is nonzero, the width of the trunk isn't |
64 |
| -# uniform. If verbose.level is helpful (in matplotlibrc), a message is |
65 |
| -# given in the terminal window. |
66 |
| -# 2. The second flow doesn't appear because its value is zero. Again, if |
67 |
| -# verbose.level is helpful, a message is given in the terminal window. |
| 68 | +# |
| 69 | +# 1. Since the sum of the flows is nonzero, the width of the trunk isn't |
| 70 | +# uniform. If verbose.level is helpful (in matplotlibrc), a message is |
| 71 | +# given in the terminal window. |
| 72 | +# 2. The second flow doesn't appear because its value is zero. Again, if |
| 73 | +# verbose.level is helpful, a message is given in the terminal window. |
| 74 | + |
68 | 75 |
|
69 | 76 | ###############################################################################
|
70 | 77 | # Example 3
|
| 78 | +# |
71 | 79 | # This demonstrates:
|
72 |
| -# 1. Connecting two systems |
73 |
| -# 2. Turning off the labels of the quantities |
74 |
| -# 3. Adding a legend |
| 80 | +# |
| 81 | +# 1. Connecting two systems |
| 82 | +# 2. Turning off the labels of the quantities |
| 83 | +# 3. Adding a legend |
75 | 84 |
|
76 | 85 | fig = plt.figure()
|
77 | 86 | ax = fig.add_subplot(1, 1, 1, xticks=[], yticks=[], title="Two Systems")
|
|
0 commit comments