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 [5]:
MONTHS = np.arange(12) + 1
d12 = read('p12.dat')
prec12 = []
PREC = prec12, prec13, prec14

for i in MONTHS:
    prec12.append(sum(d12[i]))

In [6]:
bar_graph(['2012', '2013', '2014'])



In [ ]: