I am quite newbie into matplotlib and I am struggling to plot a line graph because of my x axis.
I have 3 lists:
x=[01-01-2018,02-01-2018,03-01-2018]
y1=[10,12,9]
y2=[7,9,1]
I am looking forward to plot a 2 line graph setting in the x axis the dates:
I am looking forward to do this using subplots in order to customize the graphs as I like.
In order to do this what I tried was:
ax1=plt.subplot2grid((1,1),(0,0))
ax1.plot(x,y1,label='test1')
ax1.plot(x,y2,label='test2')
plt.show()
However it outputs:
ValueError: could not convert string to float: '01-01-2018'
I would like an output the 2 line graph and in the x axis the dates. How can I display the desired output?