Aug-22-2017, 10:21 AM
(Aug-21-2017, 08:26 AM)cps13 Wrote: 16:10:24,1.00T
16:10:25,1.10T
16:10:26,1.15T
16:10:27,1.16T
16:10:28,1.14T
def graph(self):
x,y = np.loadtxt('test.csv', delimiter=',', unpack=True)
plt.plot(x,y)
plt.xlabel('Time')
plt.ylabel('Load Value')
plt.title('Logged Load\n')
plt.show()
I have not tested in in this code, but I suggest a quickfix like this: (given that the T is always at the end of the string.
plt.plot(x,y) ----> plt.plot(x,float(y[:-1]))
[:-1] removes the last character of the string before float turns it into a decimal number.
Hope that works as a simple solution.
- Andre