Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. 1, 0.9
  2. 2, 1.1
  3. 3, 1.7
  4. 4, 2.8
  5. 5, 6.7
  6. 6, 8.0
  7.  
  8. import numpy as np
  9. import os
  10. import matplotlib.pyplot as plt
  11. import pylab
  12. import re
  13. import csv
  14.  
  15. intur1=open("input1", 'r')
  16. list1=[line.split() for line in intur1]
  17. listnum1=[list1[n][0] for n in range(len(list1))]
  18. x1=[list1[n][1] for n in range(len(list1))]
  19. intur2=open("input2", 'r')
  20. list2=[line.split() for line in intur2]
  21. listnum2=[list2[n][0] for n in range(len(list2))]
  22. x2=[list2[n][1] for n in range(len(list2))]
  23. ttlavg=[(float(x1[n])+float(x2[n]))/2 for n in range (len(list1))]
  24. f1=plt.figure(1)
  25. line1=plt.plot(listnum1, x1, 'b-', label = "t1")
  26. line2=plt.plot(listnum2, x2, 'r-', label = "t2")
  27. line3=plt.plot(listnum2, avg, 'g-', label = "Average")
  28. plt.xlabel("Time")
  29. plt.ylabel("Turbidity")
  30. plt.title("Turbidity plot")
  31. legend1=plt.legend(loc="best")
  32. plt.savefig("Outfile.png")
  33. plt.close(1)
  34. intur1.close()
  35. intur2.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement