forked from hodcroftlab/covariants
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolors_and_countries.py
107 lines (96 loc) · 2.05 KB
/
colors_and_countries.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
country_list =[
'France',
'United Kingdom',
'Austria',
'Netherlands',
'Norway',
'Spain',
'Belgium',
'Switzerland',
'Germany',
'USA',
'Ireland',
'Italy',
'New Zealand',
'Sweden',
'Australia',
'Singapore',
'Denmark',
'Hong Kong',
'Portugal',
'Luxembourg',
'Lithuania',
'Iceland',
'Czech Republic'
]
colors = [
"#a6cee3",
"#1f78b4",
"#ffff00",
"#33a02c",
"#fb9a99",
"#e31a1c",
"#fdbf6f",
"#ff7f00",
"#cab2d6",
"#6a3d9a",
"#b2df8a",
"#b15928",
"#000000",
"#9900cc",
"#ffcc00",
"#a6a6a6",
"#0099ff",
"#d9d9d9",
'#990000',
'#c2c2a3',
'#ff66ff',
'#0000ff',
'#006600'
]
#separate out Scotland, England, NI, Wales...
uk_countries = ['Scotland', 'England', 'Wales', 'Northern Ireland']
countries_and_uk_list = [x for x in country_list if x!='United Kingdom'] + uk_countries
all_countries = country_list + uk_countries
# For the main cluster, ran out of colors... try this hack.
# palette = sns.color_palette("tab10", round(len(country_list)/2))
linestyles = ['-', '-.','--', ':']
country_styles = {
country: {'c':colors[i], 'ls':linestyles[i//len(colors)]}
for i, country in enumerate(country_list)
}
country_styles.update({
'Scotland': {'c':country_styles['United Kingdom']['c'], 'ls':'--'},
'England': {'c':country_styles['United Kingdom']['c'], 'ls':'-'},
'Wales': {'c':country_styles['United Kingdom']['c'], 'ls':'-.'},
'Northern Ireland':{'c':country_styles['United Kingdom']['c'], 'ls':':'},
})
popsizes = {
'Spain':46723749,
'United Kingdom': 66488991,
'Switzerland':8516543,
'Netherlands':17231017,
'Norway':5314336,
'Germany':82927922,
'France':66987244,
'Ireland':4853506,
'Belgium':11422068,
'Denmark':5797446,
"Scotland": 5469000,
"Wales":3136000
}
country_list_2 = [
"Israel",
"Brazil",
"Slovakia",
"Hungary",
"Turkey",
"South Africa",
"United Arab Emirates",
"Finland"
]
country_styles_2 = {
country: {'c':colors[i], 'ls':":"}#linestyles[i//len(colors)]}
for i, country in enumerate(country_list_2)
}
country_styles_all = {**country_styles, **country_styles_2}