I have a text file with almost 50k lines of data from sensors that are connected to a raspberry pi. It looks something like this:
2014-07-16 15:57:35.536579, 128, 251, 254, 255, 30.062
2014-07-16 15:57:37.763030, 132, 252, 250, 255, 30.062
2014-07-16 15:57:39.993090, 135, 249, 239, 255, 30.125
2014-07-16 15:57:42.224499, 142, 251, 221, 255, 30.125
2014-07-16 15:57:44.452908, 152, 252, 199, 255, 30.187
2014-07-16 15:57:46.683009, 162, 246, 189, 255, 30.187
So basically (from left to right) date and time, sensor 1, sensor 2, sensor 3, sensor 4, sensor 5. I want to plot this by using Python, Ive read about matplotlib for plotting graphs. But how can I plot this data from a text file? I would like to plot on the x axis the timestamps and on the y axis the data from different sensors in one chart. Im not experienced in matplotlib at all.
For reading the text file I was thinking of something like this:
line = file.readlines()
new_line = line.strip(", ")
date = new_line[0]
sensor1 = new_line[1]
#and so on
set timefmt "%Y-%m-%d %H:%M:%S"; set xdata time;plot 't.gp' using 1:2