''' Created on Mar 28, 2014 @author: Brett Paufler Copyright Brett Paufler ''' import pickle import numpy as np import matplotlib.pyplot as plt picklePath = ".\\cornPickleReport\\highLow.txt" with open(picklePath, "r") as dataFile: print "Opening highLow.txt" d = pickle.load(dataFile) print repr(d) years = range(1970, 2014, 1) low = [] high = [] averageFraction = [] f = open('highLowData.txt', 'w') for year in years: future = "CZ" + str(year) low.append(d[future]["Low"]) high.append(d[future]["High"]) averageFraction.append(d[future]["High"] / d[future]["Low"] * 100) f.write(future + "\tLow: " + str(d[future]["Low"]) + "\tHigh: " + str(d[future]["High"]) + "\n") f.close() print years print low print high print averageFraction ''' FILL GRAPHS ''' plt.bar(years,high, color='green') plt.bar(years,low, color='yellow') #plt.fill(years, high, 'b') #plt.fill(years, averageFraction, 'r') #plt.fill(years, low, "yellow") plt.grid(True) plt.show() print "End Graph Run"