require 'csv'
require 'gruff'
data=CSV.read('wajima_population.csv',headers: true)
day=data['day'].map(&:to_i)
populations=data['all'].map(:to_i)
g=Gruff::Line.new
g.title='輪島市の人口の推移'
g.labels=day.each_with_index.map{|day, index| [index,day.to_s]}.to_hg.data(:人口, populations)
gwrite('population_trend.jpeg')
