Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import matplotlib.pyplot as plt
- barWidth = 0.08
- bars1 = [9.989039, 7.882399, 6.921668, 0]
- bars2 = [10, 7.5, 10.0, 7.5]
- bars3 = [9.922565, 6.510063, 7.531732, 4.984073]
- bars4 = [8.444444, 9.444444, 5.966667, 5.433333]
- bars5 = [8.894444, 9.444444, 4.596296, 4.405556]
- bars6 = [9.333333, 5.333333, 1.666667, 0.333333]
- bars7 = [10, 10, 10, 0]
- bars8 = [10, 10, 10, 0]
- bars9 = [3.104365, 4.291211, 4.197311, 4.984073]
- bars10 = [5.952675, 5.083334, 4.606659, 4.984073]
- r1 = np.arange(len(bars1))
- r2 = [x + barWidth for x in r1]
- r3 = [x + barWidth for x in r2]
- r4 = [x + barWidth for x in r3]
- r5 = [x + barWidth for x in r4]
- r6 = [x + barWidth for x in r5]
- r7 = [x + barWidth for x in r6]
- r8 = [x + barWidth for x in r7]
- r9 = [x + barWidth for x in r8]
- r10 = [x + barWidth for x in r9]
- plt.bar(r1, bars1, color='mediumpurple', width=barWidth, edgecolor='white', label='пропажи людей')
- plt.bar(r2, bars2, color='plum', width=barWidth, edgecolor='white', label='проажи женщин')
- plt.bar(r3, bars3, color='m', width=barWidth, edgecolor='white', label='безопасность')
- plt.bar(r4, bars4, color='mediumvioletred', width=barWidth, edgecolor='white', label='религиозные преследования')
- plt.bar(r5, bars5, color='palevioletred', width=barWidth, edgecolor='white', label='свобода вероисповеданий')
- plt.bar(r6, bars6, color='hotpink', width=barWidth, edgecolor='white', label='законы, органичивающие медиа')
- plt.bar(r7, bars7, color='rebeccapurple', width=barWidth, edgecolor='white', label='однополые отношения')
- plt.bar(r8, bars8, color='deeppink', width=barWidth, edgecolor='white', label='разводы')
- plt.bar(r9, bars9, color='magenta', width=barWidth, edgecolor='white', label='независимость суда')
- plt.bar(r10, bars10, color='darkmagenta', width=barWidth, edgecolor='white', label='доверие к полиции')
- plt.figure(figsize=(12,10))
- plt.xlabel('Страна', fontweight='bold')
- plt.xticks([r + barWidth for r in range(len(bars1))], ['Нидерланды', 'Кот д`Ивуар', 'Россия', 'Сирия'])
- plt.legend(fontsize = 'x-small')
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement