I have a code in which I create a data frame from the data of a bunch of sensors, select which type of sensor I wish to observe, and the period over which I would like to observe this sensor. The data is then plotted and saved to an Excel file. The following is a snippet of what my data frame looks like.
Site Name Sensor Display Name Readings Datetime
342 100 Adelaide EY_VAV_31_05 - Space Temperature 2021-01-01 00:06:00
343 100 Adelaide EY_VAV_31_05 - Space Temperature 2021-01-01 00:21:00
344 100 Adelaide EY_VAV_31_05 - Space Temperature 2021-01-01 00:36:00
345 100 Adelaide EY_VAV_31_05 - Space Temperature 2021-01-01 00:52:00
346 100 Adelaide EY_VAV_31_05 - Space Temperature 2021-01-01 01:06:00
My issue is that when I plot the data, I would like to get the dates of each day I observe to be the labels for my X-axis. Instead, I get the number of hours since the beginning of the data. I'm a little new to matplotlib, and don't fully understand how I can fix this. The following is the code used to plot everything.
chosen['Readings Value'].plot()
plt.xlabel('Hour')
plt.ylabel('Sensor Reading')
plt.show()
I don't want to use pd.groupby to reorganize the data by day, as I need to keep all of the data for every hour. Any help will be appreciated, thank you.