Initialize Experiment


In [1]:
import numpy as np
import matplotlib.pyplot as plt
from precipitation import read, prepare
%matplotlib inline
"Initialized"


Out[1]:
'Initialized'

Bar graph plot function

  • PREC contains the precipitation data
  • MONTHS defines the interval
  • years is a list of legends

In [2]:
def bar_graph(years):
    global PREC, MONTHS
    prepare(PREC, MONTHS, years, plt)
    plt.savefig("out.png")

Experiment


In [3]:
MONTHS = np.arange(12) + 1
d13, d14 = read('p13.dat'), read('p14.dat')
PREC = prec13, prec14 = [], []

for i in MONTHS:
    prec13.append(sum(d13[i]))
    prec14.append(sum(d14[i]))

In [4]:
bar_graph(['2013', '2014'])



In [ ]: