1 """Make combined histograms of the male and female articles, by birth year and first edit date."""
3 from matplotlib import pyplot, dates
5 figure = pyplot.figure()
7 axes1 = figure.add_subplot(2, 1, 1)
8 birth_years_male = wikibios.columns_male['birth_year']
9 birth_years_female = wikibios.columns_female['birth_year']
10 axes1.hist([birth_years_female, birth_years_male], bins=50, stacked=True, range=[1514, 2014])
11 axes1.set_xlabel('Birth Year')
12 axes1.set_ylabel('Articles')
14 axes2 = figure.add_subplot(2, 1, 2)
15 firstedits_male = dates.date2num(wikibios.columns_male['firstedit'])
16 firstedits_female = dates.date2num(wikibios.columns_female['firstedit'])
17 axes2.hist([firstedits_female, firstedits_male], bins=50, stacked=True, label=['Female', 'Male'])
18 axes2.xaxis.set_major_formatter(dates.AutoDateFormatter(dates.AutoDateLocator()))
20 axes2.set_xlabel('Article Year')
21 axes2.set_ylabel('Articles')
23 figure.savefig('histograms.pdf')