@@ -15,15 +15,17 @@ the mapping of numbers to emoji.
15
15
# on Windows, this font may be necessary to display emojis
16
16
plt.rcParams['font.family'] = "Segoe UI Emoji"
17
17
18
- def display_in_cats(values, min_cats, max_cats):
19
18
19
+ def display_in_cats(values, min_cats, max_cats):
20
20
def display_in_cat_scale(value):
21
21
max_value = max(values, key=abs)
22
- number_cats_to_show = max(min_cats, math.floor(abs(value) / max_value * max_cats))
22
+ number_cats_to_show = \
23
+ max(min_cats, math.floor(abs(value) / max_value * max_cats))
23
24
return str(number_cats_to_show * 'π')
24
25
25
26
return display_in_cat_scale
26
27
28
+
27
29
flows = [35, 15, 40, -20, -15, -5, -40, -10]
28
30
orientations = [-1, 1, 0, 1, 1, 1, -1, -1]
29
31
@@ -41,6 +43,7 @@ the mapping of numbers to emoji.
41
43
42
44
diagrams[0].texts[2].set_text('')
43
45
44
- plt.title(f'Sankey flows measured in cats \n π = {max(flows, key=abs) / max_cats}')
46
+ plt.title(f'Sankey flows measured in cats \n '
47
+ f'π = {max(flows, key=abs) / max_cats}')
45
48
46
49
plt.show()
0 commit comments