I am trying to plot with 2 y axis and a shared x axis. I have gotten to this point, but its not the x axis I want.
Here is my code:
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_excel("Live_data_test.xlsx","Sheet1")
timedat = df.loc[:, 'Time']
temperaturedat = df.loc[:, 'Temperature']
humiditydat = df.loc[:, 'Humidity']
fig, ax1 = plt.subplots()
ax2 = ax1.twinx()
ax1.plot(timedat, temperaturedat, 'g-')
ax2.plot(timedat, humiditydat, 'b-')
ax1.set_xlabel('Time')
ax1.set_ylabel('Temperature', color='g')
ax2.set_ylabel('Humidity', color='b')
plt.show()
The x axis is plotting as 0,1,2,... for however many points I have. It is not plotting the defined x axis which should be unix time that I have set in the spreadsheet.
Spreadsheet:
Time Temperature Humidity
1513753200 54 45
1513753201 55 48
1513753202 55 50
1513753203 56 52
1513753204 56 54
1513753205 57 54
1513753206 56 54
1513753207 56 55
1513753208 56 56
1513753209 55 56
1513753210 54 52
1513753211 53 50
1513753212 52 45
1513753213 51 45
When I do print(timedat) I get this:
0 1.513753e+09
1 1.513753e+09
2 1.513753e+09
3 1.513753e+09
4 1.513753e+09
5 1.513753e+09
6 1.513753e+09
7 1.513753e+09
8 1.513753e+09
9 1.513753e+09
10 1.513753e+09
11 1.513753e+09
12 1.513753e+09
13 1.513753e+09
Name: Time, dtype: float64
I believe converting unix time to H:M:S M/D/Y time should be simple enough. I have been searching for hours trying to plot the x axis as the defined time, but to no avail.

df.Time = df.Time.astype(int)?df.Time = df.Time.astype(str)