I'm importing data from a .json file, where I transformed the dictionary into a list of tuples. These tuples represent the data as a timestamp and a value marked at that specified timestamp, such as this example:
participant_1 = [(1, 8), (2, 2), (3, 2), (4, 1), (5, 3), (6, 5), (7, 6), (8, 6), (9, 8), (10, 9), (11, 9), (12, 9), (13, 3), (14, 3), (15, 4), (16, 5), (17, 6), (18, 6), (19, 7), (20, 8), (21, 8), (22, 9), (23, 9), (24, 9), (25, 9), (26, 9), (27, 9)]
participant_2 = [(1, 5), (2, 5), (3, 1), (4, 3), (5, 4), (6, 5), (7, 5), (8, 7), (9, 8), (10, 9), (11, 10), (12, 10), (13, 10), (14, 10), (15, 10), (16, 10), (17, 10), (18, 0), (19, 0), (20, 0), (21, 0), (22, 0), (23, 0), (24, 0), (25, 0), (26, 0), (27, 0)]
I'll have multiple lists (of multiple participants) where the timestamp (first value of the tuple) will not change but the second (marked value) will. What I want to do is plot a graph where I can compare the marked values (therefore, the x-axis will be the time and the y-axis the marked values).
The way I want to compare the data is by horizontal bars where a different color would represent the marked value. These values range from 0 - 10. Thus, for each of these values, I would like to assign a color. In this way, there would be multiple horizontal bars, for each participant, and for each marked value, a different color (so that I can see the differences between the marked values of participants).
I do not wish for multiple bars for each participant - more like a stacked graph where the marked value would be one color, and those change according to the timestamp. In this way, I would be able to compare the marked values of the participants in a timeframe. I have an example from a paper:
However, I couldn't find any way to do this yet.
Thanks.