0

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

enter image description here

Is it possible to expand it so it uses day and time or even day and time in bins?

Jim Jones
  • 47
  • 3
  • to me, the problem seems to be your range of date/time (2016-05 to 2016-06). if you want to see a certain section of the data in more detail, you'll have to change the xrange – FObersteiner May 12 '21 at 14:01
  • Does something like [this](https://stackoverflow.com/q/1574088/15740324) help? – Standard_101 May 12 '21 at 14:01

0 Answers0