Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import csv
- import matplotlib.pyplot as plt
- x = []
- y = []
- y2 = []
- # table[row][col]
- file_csv = open("log.csv", newline="")
- file_content = csv.reader(file_csv, delimiter=",")
- fileContentList = list(file_content)
- colRange = range((len(fileContentList[2]) - 1))
- rowRange = range(2, (len(fileContentList) - 1))
- manyPlots = 0
- while True:
- for col in colRange:
- print("Col #", col, " stands for ", (fileContentList[2][col].strip(" ")))
- colChosen = int(input("Which one do you choose? "))
- colChosen2 = int(input("Which next do you choose?"))
- for row in rowRange:
- #print(fileContentList[row][colChosen])
- y.append(fileContentList[row][colChosen])
- y2.append(fileContentList[row][colChosen2])
- x.append(fileContentList[row][1])
- break
- title = "Graph {} of {} and {}"
- plt.title(title.format(x[0], y[0], y2[0]))
- #plt.xlabel(x[0]) #first element of table contains name of value
- #plt.ylabel(y[0]) #first element of table contains name of value
- plt.plot(x, y, label = y[0][1])
- plt.plot(x, y2, label = y2[0][1])
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement