Log in

HCMC Journal

How do I generate the time graphs I’ve seen you display?

: Deniz Aydin
Minutes: 60

I’ve written a little Python script that pulls in sample data contained in the Narratives data visualization repository. This data come in two separate files: TheSoundandtheFuryTimeGraphJuly2024.xlsx and TheSoundandtheFuryTellingTimesJuly2024.xlsx. The first file has two tabs, called Events and Pages respectively. Events includes data about the time period over which the event occurs, its description, and the people involved in the event (as Boolean values). The second sheet, Pages, also contains the description of the event (although the relevant column is titled Event on one sheet and Description in the other), the narrator, and the pages that span the event. There is also a column that describes the telling time, but since the values in there are string descriptions of the telling time, this was not easy to plot. Instead, I’ve asked for telling time timestamps to be included in the events, and Corinne has sent me a new spreadsheet called TheSoundandtheFuryTellingTimesJuly2024.xlsx. This spreadsheet correlates the timestamps with the description of the telling time.

As for the Python script that does the plotting, the sequence of operations are as follows:

So now, if you press play, you should get the final output with all the data in a pop-up matplotlib window. You can move your cursor and read the data point values on the bottom, as they are displayed live.