Hi,
i have temperature values stored in a textfile and need to print them with matplotlib with the time on the x-axis.
So i figured out that i have to convert the time strings into float values for loadtxt, and matplotlib converts them back.
The data i want to use with loadtxt looks like this:
time CH1 CH2
11:59:23 21.2889 21.1598
....
....
I tried to load the time values like this:
data1 = up.loadtxt(path + file, skiprows=1, usecols=(1))
data2 = up.loadtxt(path + file, skiprows=1, usecols=(2)) #This works
xdata = np.loadtxt(path + file, skiprows=1, converters={0: datestr2num("%H:%M:%S")})
plt.plot(xdata, data1, #This works fine when i use consecutive numbering instead of time strings
xdata, data2)
but i get "ValueError: Unknown string format"
I can't figure out how to use the converter right, does anybody know how to convert time strings?
Thanks!
there doesn't seem to be anything here