Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2012
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import string, re, pylab
  2.  
  3. xAxis=[]
  4. yAxis=[]
  5.  
  6. def loadData():
  7.     dataFile=open('julyTemps.5ee3cdb7fafe.txt', 'r', 0)
  8.     for line in dataFile:
  9.         for c in string.digits:
  10.             if re.match(c, line):
  11.                 xAxis.append(line.split()[0])
  12.                 yAxis.append(line.split()[1])
  13.     dataFile.close()
  14. loadData()
  15.  
  16. def makePlot():
  17.     pylab.figure(1)
  18.     pylab.title('Boston July Highest Temperatures')
  19.     pylab.xlabel('Day')
  20.     pylab.ylabel('Highest Temperature (F)')
  21.     pylab.plot(xAxis, yAxis, 'r', linewidth=3)
  22.     pylab.show()
  23. makePlot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement