from
math
import
pi
import
matplotlib.pyplot as plt
cat
=
[
'Speed'
,
'Reliability'
,
'Comfort'
,
'Safety'
,
'Effieciency'
]
values
=
[
90
,
60
,
65
,
70
,
40
]
N
=
len
(cat)
x_as
=
[n
/
float
(N)
*
2
*
pi
for
n
in
range
(N)]
values
+
=
values[:
1
]
x_as
+
=
x_as[:
1
]
plt.rc(
'axes'
, linewidth
=
0.5
, edgecolor
=
"#888888"
)
ax
=
plt.subplot(
111
, polar
=
True
)
ax.set_theta_offset(pi
/
2
)
ax.set_theta_direction(
-
1
)
ax.set_rlabel_position(
0
)
ax.xaxis.grid(
True
, color
=
"#888888"
, linestyle
=
'solid'
, linewidth
=
0.5
)
ax.yaxis.grid(
True
, color
=
"#888888"
, linestyle
=
'solid'
, linewidth
=
0.5
)
plt.xticks(x_as[:
-
1
], [])
plt.yticks([
20
,
40
,
60
,
80
,
100
], [
"20"
,
"40"
,
"60"
,
"80"
,
"100"
])
ax.plot(x_as, values, linewidth
=
2
, linestyle
=
'solid'
, zorder
=
3
)
ax.fill(x_as, values,
'b'
, alpha
=
0.0
)
plt.ylim(
0
,
100
)
for
i
in
range
(N):
angle_rad
=
i
/
float
(N)
*
2
*
pi
if
angle_rad
=
=
0
:
ha, distance_ax
=
"center"
,
10
elif
0
< angle_rad < pi:
ha, distance_ax
=
"left"
,
1
elif
angle_rad
=
=
pi:
ha, distance_ax
=
"center"
,
1
else
:
ha, distance_ax
=
"right"
,
1
ax.text(angle_rad,
100
+
distance_ax, cat[i], size
=
10
, horizontalalignment
=
ha, verticalalignment
=
"center"
)
plt.show()