I need help with understanding the answer to this questions asked previously here on stackoverflow:
Pandas - Stacked horizontal barchat for timeline?
The question was about using a stacked horizontal bar-chart as a timeline. The answer given works but there isn't the possibility to see the dataframe from which the graph is generated and this is where I'm getting stuck. I would like to do something similar to this but since I can't see the df I don't really know how to replicate it.
I want to track the different states of bodies over-time on a timeline such as that one.
Anyone know how this would work?
This was the code given in the answer:
fig, ax = plt.subplots()
df.plot(kind='barh', stacked=True, ax=ax)
ax.set_yticklabels(['A', 'B', 'C', 'D', 'E', 'F'])
time = pd.date_range(start=pd.to_datetime('07:00', format='%H:%M'), end=pd.to_datetime('13:00', format='%H:%M'),freq='H')
time_x = [dt.strftime('%H:%M') for dt in time]
ax.set_xticklabels(time_x)
fig.autofmt_xdate()
plt.show()