Advertisement
Guest User

Untitled

a guest
Sep 14th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.08 KB | None | 0 0
  1. import csv
  2. import matplotlib.pyplot as plt
  3.  
  4.  
  5. x = []
  6. y = []
  7. y2 = []
  8.  
  9. # table[row][col]
  10.  
  11. file_csv = open("log.csv", newline="")
  12. file_content = csv.reader(file_csv, delimiter=",")
  13. fileContentList = list(file_content)
  14. colRange = range((len(fileContentList[2]) - 1))
  15. rowRange = range(2, (len(fileContentList) - 1))
  16. manyPlots = 0
  17.  
  18. while True:
  19.     for col in colRange:
  20.         print("Col #", col, " stands for ", (fileContentList[2][col].strip(" ")))
  21.     colChosen = int(input("Which one do you choose? "))
  22.     colChosen2 = int(input("Which next do you choose?"))
  23.     for row in rowRange:
  24.         #print(fileContentList[row][colChosen])
  25.         y.append(fileContentList[row][colChosen])
  26.         y2.append(fileContentList[row][colChosen2])
  27.         x.append(fileContentList[row][1])
  28.     break
  29.  
  30.  
  31.  
  32. title = "Graph {} of {} and {}"
  33. plt.title(title.format(x[0], y[0], y2[0]))
  34. #plt.xlabel(x[0]) #first element of table contains name of value
  35. #plt.ylabel(y[0]) #first element of table contains name of value
  36. plt.plot(x, y, label = y[0][1])
  37. plt.plot(x, y2, label = y2[0][1])
  38. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement