-
Notifications
You must be signed in to change notification settings - Fork 0
/
RD_vs_ERC_pl.py
138 lines (126 loc) · 5.69 KB
/
RD_vs_ERC_pl.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 17 22:30:07 2016
@author: [email protected]
Dla Ruchu Społecznego Obywatele Nauki
"""
import numpy as np
import matplotlib.pyplot as plt
plt.rc('font', family='Arial')
dt = np.dtype([('Country', 'S30'), ('Abrv', 'S3'), ("isEU", 'S5'),
('RD', np.float), ('Staff', np.float), ('SciPerMln', np.float),
('Granted', np.float), ('Eval', np.float),
('SucRate', np.float)])
MS = 10
FS = 19
TFS = 15
CLR = (0.25, 0.25, 0.85, 0.65)
FIGSZ = (10, 10)
low = 1.0
high = 2.0
figFormat = "png"
legend_toupl = (u'> 2%', '1% - 2%', '< 1%', 'Polska', 'średnia')
legTitle = '% PKB na BiR'
def main():
""" """
data = np.genfromtxt("GDB_for_RD.csv", skip_header=1, dtype=dt,
delimiter=',')
pol = data[data['Abrv'] == "PL".encode()]
jeden = data[data["RD"] <= low]
dwa = data[np.logical_and(data["RD"] > low, data["RD"] <= high)]
richBoys = data[data["RD"] > high]
EU_mean_Staff = data[~np.isnan(data["Staff"])]["Staff"].mean()
# How many application were evaluated depending on number of research staff
plt.figure(1, figsize=FIGSZ)
rb, = plt.loglog(richBoys["Staff"], richBoys["Eval"]+1, 'go', ms=MS)
dw, = plt.loglog(dwa["Staff"], dwa["Eval"]+1, 'o', ms=MS, color=CLR)
jj, = plt.loglog(jeden["Staff"], jeden["Eval"]+1, 'yo', ms=MS)
pl, = plt.loglog(pol["Staff"], pol["Eval"]+1, 'ro', ms=MS)
eu, = plt.loglog(EU_mean_Staff, np.mean(data["Eval"]+1), 'cD', ms=MS-2)
plt.xlabel(u"Liczba badaczy na etatach w tys. [dane na 2014 r.]",
fontsize=FS)
plt.ylabel(u"Liczba wszystkich rozpatrzonych wniosków o granty ERC w 2015",
fontsize=FS)
for i, xy in enumerate(zip(data["Staff"], data["Eval"]+1)):
plt.annotate(data['Abrv'][i].decode(), xy=xy, textcoords='data')
plt.annotate("mean", xy=(EU_mean_Staff, np.mean(data["Eval"]+1)),
textcoords='data')
markers_toupl = (rb, dw, jj, pl, eu)
plt.legend(markers_toupl, legend_toupl, loc='lower right',
framealpha=0, numpoints=1, title=legTitle)
plt.xticks(fontsize=TFS)
plt.yticks(fontsize=TFS)
plt.xlim(xmin=1)
plt.grid(True)
plt.savefig("EvalERC_Staff." + figFormat)
# How many projects got approved depending on number of research staff
plt.figure(2, figsize=FIGSZ)
plt.loglog(richBoys["Staff"], richBoys["Granted"]+1, 'go', ms=MS)
plt.loglog(jeden["Staff"], jeden["Granted"]+1, 'yo', ms=MS)
plt.loglog(dwa["Staff"], dwa["Granted"]+1, 'o', ms=MS, color=CLR)
plt.loglog(pol["Staff"], pol["Granted"]+1, 'ro', ms=MS)
plt.loglog(EU_mean_Staff, np.mean(data["Granted"]+1), 'cD', ms=MS-2)
plt.xlabel(u"Liczba badaczy na etatach w tys. [dane na 2014 r.]",
fontsize=FS)
plt.ylabel(u"Liczba pozytywnie rozpatrzonych wniosków o granty" +
" ERC w 2015", fontsize=FS)
for i, xy in enumerate(zip(data["Staff"], data["Granted"]+1)):
plt.annotate(data['Abrv'][i].decode(), xy=xy, textcoords='data')
plt.annotate("mean", xy=(EU_mean_Staff, np.mean(data["Granted"]+1)),
textcoords='data')
plt.legend(markers_toupl, legend_toupl, loc='lower right', framealpha=0,
numpoints=1, title=legTitle)
plt.xticks(fontsize=TFS)
plt.yticks(fontsize=TFS)
plt.xlim(xmin=1)
plt.grid(True)
plt.savefig("GrantedERC_Staff." + figFormat)
# Success rate vs fraction of GDP spend on R&D
plt.figure(3, figsize=FIGSZ)
plt.plot(richBoys['RD'], richBoys['SucRate'], 'go', ms=MS)
plt.plot(jeden['RD'], jeden['SucRate'], 'yo', ms=MS)
plt.plot(dwa['RD'], dwa['SucRate'], 'o', ms=MS, color=CLR)
plt.plot(pol['RD'], pol['SucRate'], 'ro', ms=MS)
plt.plot(np.mean(data["RD"]), np.mean(data["SucRate"]), 'cD', ms=MS-2)
plt.xlabel(u"Proc. PKB na badania i rozwój [dane na 2014 r.]",
fontsize=FS)
plt.ylabel("Wskaźnik sukcesu wliczajacy wszytkie konkursy ERC w 2015",
fontsize=FS)
for i, xy in enumerate(zip(data['RD'], data['SucRate'])):
plt.annotate(data['Abrv'][i].decode(), xy=xy, textcoords='data')
plt.annotate("mean", xy=(np.mean(data["RD"]), np.mean(data["SucRate"])),
textcoords='data')
plt.legend(markers_toupl, legend_toupl, loc='lower right', framealpha=0,
numpoints=1, title=legTitle)
plt.xticks(fontsize=TFS)
plt.yticks(fontsize=TFS)
plt.ylim(ymax=0.30001)
plt.grid(True)
plt.savefig("SucRate_GDP." + figFormat)
# Number of scientist per million people vs R&D spending
plt.figure(4, figsize=FIGSZ)
plt.plot(richBoys['RD'], richBoys['SciPerMln'], 'go', ms=MS)
plt.plot(jeden['RD'], jeden['SciPerMln'], 'yo', ms=MS)
plt.plot(dwa['RD'], dwa['SciPerMln'], 'o', ms=MS, color=CLR)
plt.plot(pol['RD'], pol['SciPerMln'], 'ro', ms=MS)
plt.plot(np.mean(data["RD"]), np.mean(data["SciPerMln"]), 'cD', ms=MS-2)
plt.xlabel(u"Proc. PKB na badania i rozwój [dane na 2014 r.]",
fontsize=FS)
plt.ylabel("Liczba badaczy przypadająca na million mieszkanców" +
" [dane na 2014 r.]", fontsize=FS)
for i, xy in enumerate(zip(data['RD'], data['SciPerMln'])):
plt.annotate(data['Abrv'][i].decode(), xy=xy, textcoords='data')
plt.annotate("mean", xy=(np.mean(data["RD"]), np.mean(data["SciPerMln"])),
textcoords='data')
plt.legend(markers_toupl, legend_toupl, loc='lower right', framealpha=0,
numpoints=1, title=legTitle)
plt.xticks(fontsize=TFS)
plt.yticks(fontsize=TFS)
plt.grid(True)
# plt.tight_layout()
plt.savefig("GDP_SciPerMln." + figFormat)
print("Done!")
plt.show()
if __name__ == "__main__":
main()