I have a nested dictionary that looks like this:
{'Track_108': {'Track_3994': [(1, 6)],
'Track_4118': [(8, 9)],
'Track_4306': [(25, 26), (28, 30)]},
'Track_112': {'Track_4007': [(19, 20)]},
'Track_121': {'Track_4478': [(102, 104)]},
'Track_130': {'Track_4068': [(132, 134)]},
'Track_141': {'Track_5088': [(93, 95)],
'Track_5195': [(103, 104), (106, 107)]}
The lists are intervals (durations) of a certain event. With the first number being the "start-frame" and the second number the "last-frame". So "Track_3994" has an event that has a duration of 6 frames.
I want to plot a histplot with on the x-axis the duration of events and the y axis a count. I need one histplot for the whole dictionary and preferebly also a histplot for each track that you see in the first column.
This would be a graph for the whole dictionary. The y-axis represent the count of how many times a duration is in the dictionary. For the data I provided there is only one event with a duration of 6, so that bar would have a height of 1. The bar of 2 on the x-axis will have a height of 5 on the y-axis, because there are 5 events with a duration of 2 frames.
For the graphs for each track the histogram will only show the duration distribution of that track. So these graphs will be a lot smaller. Eg. track_108 will have a graph that has a bar of height 2 for x=2, a bar of height 1 for x=3, and a bar of height 1 for x=6.