stem_cats = ['Psychology', 'Biology', 'Math and Statistics', 'Physical Sciences', 'Computer Science', 'Engineering']
lib_arts_cats = ['Foreign Languages', 'English', 'Communications and Journalism', 'Art and Performance', 'Social Sciences and History']
other_cats = ['Health Professions', 'Public Administration', 'Education', 'Agriculture','Business', 'Architecture']
all_cats = []
all_cats.append(stem_cats)
all_cats.append(lib_arts_cats)
all_cats.append(other_cats)
fig = plt.figure(figsize=(17, 17))
for sp in range(0,3):
position = sp+1
cats_array = all_cats[sp]
for i in range(0,6):
if position != 17:
ax = fig.add_subplot(6,3,position)
ax.plot(women_degrees['Year'], women_degrees[cats_array[i]], c=cb_dark_blue, label='Women', linewidth=3)
ax.plot(women_degrees['Year'], 100-women_degrees[cats_array[i]], c=cb_orange, label='Men', linewidth=3)
ax.spines["right"].set_visible(False)
ax.spines["left"].set_visible(False)
ax.spines["top"].set_visible(False)
ax.spines["bottom"].set_visible(False)
ax.set_xlim(1968, 2011)
ax.set_ylim(0,100)
ax.set_title(cats_array[i])
ax.tick_params(bottom="off", top="off", left="off", right="off", labelbottom='off')
ax.set_yticks([0,100])
ax.axhline(50, c=(171/255, 171/255, 171/255), alpha=0.3)
if position == 1:
ax.text(2005, 82, 'Women')
ax.text(2005, 10, 'Men')
elif position == 2:
ax.text(2005, 20, 'Men')
ax.text(2005, 78, 'Women')
elif position == 3:
ax.text(2005, 5, 'Men')
ax.text(2005, 90, 'Women')
elif position == 14:
ax.tick_params(labelbottom='on')
elif position == 16:
ax.text(2005, 87, 'Men')
ax.text(2005, 7, 'Women')
ax.tick_params(labelbottom='on')
elif position == 18:
ax.text(2005, 60, 'Men')
ax.text(2005, 30, 'Women')
ax.tick_params(labelbottom='on')
position+=3
plt.savefig("gender_degrees.png")
plt.show()