I am trying to plot the sequence of a set of time sorted values, in which each value is represented by a different colour. For instance, if my values are like
state_seq = [2, 2, 2, 2, 0, 0, 0, 1, 3, 6, 3, 3, 3, 0, 0]
time_seq = ['2013-05-29 09:31:00', '2013-05-29 09:46:00', '2013-07-23 12:28:00', '2013-07-23 01:53:00', '2013-08-05 02:02:00', '2013-08-05 02:08:00', '2013-08-05 04:28:00', '2013-08-06 10:20:00', '2013-08-06 03:03:00', '2013-08-06 04:13:00', '2013-08-06 04:17:00', '2013-08-06 04:36:00', '2013-08-07 11:07:00', '2013-08-07 12:28:00', '2013-08-07 12:31:00']
I want each unique element of state_seq to be represented with a colour and plot the sequence. As of now, I am using seaborn palplot to get this done in a trivial way as,
color_set = ["#95a5a6", "#34495e","#9b59b6", "#3498db", "#800000", "#2ecc71", 'y', '#FF4500']
palette = list()
for s in state_seq:
palette.append(color_set[s])
sns.palplot(palette)
Which gives me something like this (this output may not exactly match with the code snippet - I edited the code for better clarity)
This approach has a setback that I can not represent my time labels in x-axis. Is there a better python alternative perhaps similar to the R-package TraMineR explained here Is it possible to make a graph with pattern fills using TraMineR and R base graphs?