Oct-31-2018, 09:06 AM
Hello,
I am completely new with matplotlib. I would like to create a graph (with points), where every data on x axis is a date and y is a float number.
The datas are coming from a file, looks like (first column date, second intensity value):
20180824 289520.0
20180818 405328.0
20180824 289520.0
I am trying with this code, but I get trouble because of the date format. Can anyone help me?
I am completely new with matplotlib. I would like to create a graph (with points), where every data on x axis is a date and y is a float number.
The datas are coming from a file, looks like (first column date, second intensity value):
20180824 289520.0
20180818 405328.0
20180824 289520.0
I am trying with this code, but I get trouble because of the date format. Can anyone help me?
x = [] y = [] with open('../MLI_values/mli_value_XYZ_SUM.txt', 'r') as data_file: plots = csv.reader(data_file, delimiter=' ') for raw in plots: x.append(float(raw[0])) print(x) y.append(float(raw[1])) print(y) plt.plot(x, y, label='DATE') plt.xlabel('x') plt.ylabel('y') plt.title('blablabla') plt.legend() plt.show()