I have a dataframe that's in the format
date | class |
---|---|
01/06/2019 17:45 | 1 |
01/06/2019 20:23 | 2 |
03/06/2019 06:56 | 1 |
I'm trying to plot the changes in class against time using the code below
plt.plot_date(x, y, linestyle='solid')
plt.gcf().autofmt_xdate()
date_format = mpl_dates.DateFormatter('%d-%m-%Y')
plt.gca().xaxis.set_major_formatter(date_format)
plt.tight_layout()
However the result is, well, a mess. There are numerous entries for each day separated by time but the graph is squashing down the x axis to only show the days
Is it possible to expand it so it uses day and time or even day and time in bins?