Ejemplo n.º 1
0
	def plot_histograms(self):

		dataframe = merge_by_year(self.year)

		dataframe = dataframe.dropna()

		plt.figure()
		dataframe.hist('Income', by = 'Region', xlabelsize = 7, ylabelsize = 10, bins = 30)
		plt.xlabel('Income per Person')
		plt.ylabel('Number of Countries')
		plt.savefig('histograms_by_region_in_{}.png'.format(self.year))
		plt.close()
Ejemplo n.º 2
0
	def plot_boxplots(self):

		dataframe = merge_by_year(self.year)

		dataframe = dataframe.dropna()

		plt.figure()
		dataframe.boxplot('Income', by = 'Region')
		plt.xlabel('Region')
		plt.ylabel('Income per Person')
		plt.title('Income per Person by Region in year {}'.format(self.year))
		plt.savefig('boxplot_by_region_in_{}.png'.format(self.year))
		plt.close()