Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1, 0.9
- 2, 1.1
- 3, 1.7
- 4, 2.8
- 5, 6.7
- 6, 8.0
- import numpy as np
- import os
- import matplotlib.pyplot as plt
- import pylab
- import re
- import csv
- intur1=open("input1", 'r')
- list1=[line.split() for line in intur1]
- listnum1=[list1[n][0] for n in range(len(list1))]
- x1=[list1[n][1] for n in range(len(list1))]
- intur2=open("input2", 'r')
- list2=[line.split() for line in intur2]
- listnum2=[list2[n][0] for n in range(len(list2))]
- x2=[list2[n][1] for n in range(len(list2))]
- ttlavg=[(float(x1[n])+float(x2[n]))/2 for n in range (len(list1))]
- f1=plt.figure(1)
- line1=plt.plot(listnum1, x1, 'b-', label = "t1")
- line2=plt.plot(listnum2, x2, 'r-', label = "t2")
- line3=plt.plot(listnum2, avg, 'g-', label = "Average")
- plt.xlabel("Time")
- plt.ylabel("Turbidity")
- plt.title("Turbidity plot")
- legend1=plt.legend(loc="best")
- plt.savefig("Outfile.png")
- plt.close(1)
- intur1.close()
- intur2.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement