stem_cats = ['Psychology', 'Biology', 'Math and Statistics', 'Physical Sciences', 'Computer Science', 'Engineering', 'Computer Science']
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']
cb_grey = (171/255, 171/255, 171/255)
fig = plt.figure(figsize=(18, 18))
for sp in range(0,6):
ax = fig.add_subplot(6,3,(sp*3+1))
ax.plot(women_degrees['Year'], women_degrees[stem_cats[sp]], c=cb_dark_blue, label='Women', linewidth=3)
ax.plot(women_degrees['Year'], 100-women_degrees[stem_cats[sp]], c=cb_orange, label='Men', linewidth=3)
for key, spine in ax.spines.items():
spine.set_visible(False)
ax.set_xlim(1968, 2011)
ax.set_ylim(0, 100)
ax.set_title(stem_cats[sp])
ax.tick_params(bottom='off', top='off', left='off', right='off', labelbottom = 'off')
ax.set_yticks([0,100])
ax.axhline(50, c=cb_grey, alpha=0.3)
if sp == 5:
ax.tick_params(labelbottom = 'on')
if sp == 0:
ax.text(2004, 82, 'Women')
ax.text(2005, 15, 'Men')
elif sp == 5:
ax.text(2005, 90, 'Men')
ax.text(2004, 7, 'Women')
for sp in range(0,5):
ax = fig.add_subplot(6,3,(sp*3+2))
ax.plot(women_degrees['Year'], women_degrees[lib_arts_cats[sp]], c=cb_dark_blue, label='Women', linewidth=3)
ax.plot(women_degrees['Year'], 100-women_degrees[lib_arts_cats[sp]], c=cb_orange, label='Men', linewidth=3)
for key, spine in ax.spines.items():
spine.set_visible(False)
ax.set_xlim(1968, 2011)
ax.set_ylim(0, 100)
ax.set_title(lib_arts_cats[sp])
ax.tick_params(bottom='off', top='off', left='off', right='off', labelbottom = 'off')
ax.set_yticks([0,100])
ax.axhline(50, c=cb_grey, alpha=0.3)
if sp == 4:
ax.tick_params(labelbottom = 'on')
if sp == 0:
ax.text(2004, 76, 'Women')
ax.text(2005, 23, 'Men')
for sp in range(0,6):
ax = fig.add_subplot(6,3,(sp*3+3))
ax.plot(women_degrees['Year'], women_degrees[other_cats[sp]], c=cb_dark_blue, label='Women', linewidth=3)
ax.plot(women_degrees['Year'], 100-women_degrees[other_cats[sp]], c=cb_orange, label='Men', linewidth=3)
for key, spine in ax.spines.items():
spine.set_visible(False)
ax.set_xlim(1968, 2011)
ax.set_ylim(0, 100)
ax.set_title(other_cats[sp])
ax.tick_params(bottom='off', top='off', left='off', right='off', labelbottom = 'off')
ax.set_yticks([0,100])
ax.axhline(50, c=cb_grey, alpha=0.3)
if sp == 5:
ax.tick_params(labelbottom = 'on')
if sp == 0:
ax.text(2004, 90, 'Women')
ax.text(2005, 5, 'Men')
elif sp == 5:
ax.text(2005, 65, 'Men')
ax.text(2004, 35, 'Women')
plt.savefig('gender_degrees.png')
plt.show()