-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdiversity_bar.py
26 lines (17 loc) · 972 Bytes
/
diversity_bar.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
import matplotlib.pyplot as plt
diversity=["Pessoas não-brancas", "Gênero feminino", "LGBTQIAP+"]
non_diverse=[81, 81, 81]
diverse=[19, 19, 19]
fig=plt.figure(figsize=(12,8))
plt.bar(diversity, diverse, color='#ff774a', edgecolor='black')
plt.bar(diversity, non_diverse, bottom=diverse, color='white', edgecolor='black')
plt.xlabel('Grupo de Diversidade', fontsize=16, family='monospace')
plt.ylabel('Porcentagem de Pessoas', fontsize=16, family='monospace')
for i, percentage in enumerate(diverse)
plt.annotate(f"{percentage} %", xy=(i, percentage + 2), color='#ff774a', fontsize=16, weight='bold', ha='center', va='bottom')
plt.yticks(fontsize=14, family='monospace')
plt.xticks(fontsize=14, family='monospace')
plt.title('Pessoas que se identificam com grupos de diversidade \n (% em relação ao total de respondentes)', color='black',
fontsize=16, family='monospace')
#plt.box(False)
plt.savefig("diversity.png", bbox_inches="tight")