32 Game of Thrones Data Visualizations
By: Jeffrey Lancaster
Tags: Data Visualization, HBO, Maps, Game of Thrones, Data

Geography

The geography of the Lands of Ice and Fire is one of the unsung characters in the Game of Thrones world. The episodes dataset includes location information for each scene and each episode’s (award-winning) opening sequence, so I was curious if I could visualize patterns in the places of Game of Thrones.

Is there a pattern in the opening locations?

I had long wondered whether it would be possible to use network analysis algorithms to find a single path through all of the opening sequence locations in order to construct something of a supercut of all of the places shown throughout the Game of Thrones intro.

To start with, the force-directed visualization below shows why that’s just not possible. Notice how there are too many “loose ends”: Eastwatch, Dorne, Astapor, and Yunkai are all dangling, so a single path can’t be drawn without backtracking at some point. It is also worth noting, however, that all episodes link Winterfell to The Wall; that is the only consistent transition throughout the show (even though the representation of Winterfell changes based on who is occupying it, etc.).

The opening sequence for Season 6, Episode 9 “Battle of the Bastards” is shown below; explore all episodes in the live visualization.

Could I show them in geographic space?

This visualization draws upon the same idea, but instead represents all of the places based on the geography of this map. As above, this is the opening sequence for Season 6, Episode 9 “Battle of the Bastards”, and you can explore all episodes in the live visualization.

What about on a globe?

Showing geography in 2D space was good, but 3D would be even better, right? Well, turns out that was non-trivial since the geographic data for the Lands of Ice and Fire didn’t really exist (in a format that worked). It’s probably a topic for another post, but the short version is that I built upon what others had already done (this book and this map), converted that map (.png) to a vector image (.svg) in Illustrator and cleaned it up quite a bit, imported those outlines through a few online converters (mygeodata.cloud and mapshaper.org), then hand rolled a bit of the resulting data to make the GeoJSON which I’ve shared on github as lands-of-ice-and-fire . There was a fair bit of trial and error in making that file, and there’s a lot to say about how to do that smoothly (and freely), but I’ll leave that for another time (if you’re interested , please leave a comment and I’ll write that up).

One caveat about this geographic data: there’s no canonical globe version of these continents, so I made some assumptions when placing them on a sphere. Most importantly, I assumed that it’s cold at the poles and hot at the equator (like on Earth), so I’ve placed the Lands of Always Winter up around where the Arctic Circle would be, and I’ve placed Dorne and the Summer Isles in the Tropics. Beyond that, I didn’t create any new geographies in the world that may/may not be known, so there are some wonky cutoffs at the edges of the ‘known’ world that aren’t meant to represent the actual borders of the land masses.

This is what the resulting globe of Westeros, Essos, Sothyros, Ulthos, and loads of islands looks like with markers for the cities, castles, and ruins shown on the map. In the live visualization you can also zoom and rotate the world:

The opening sequences could look like this?

With a working geography, it then became possible to show the opening sequence locations and the path between them on the globe itself. As above, this is the opening sequence for Season 6, Episode 9 “Battle of the Bastards”, and you can explore all episodes in the live visualization.

… or this?

Taking the globe one step further, this visualization shows the path of each opening sequence while the shadows below represent all possible paths taken across all of the opening sequences. It’s a mix between the globe and the force-directed visualizations above.

Where have various characters travelled?

Lastly, what paths have characters taken throughout Game of Thrones? This visualization maps data from the episodes dataset onto the globe and traces where different characters have gone. It isn’t perfect since it’s missing some locations (so far), and assumes travel ‘as the crow flies’, but it still shows some epic travel. Below is the path Jorah Mormont has taken, and you can explore all characters who’ve been to four or more locations in the live visualization.

… And a Bold Prediction

Wouldn’t it be nice to take a data-driven approach to predicting who will end up on the Iron Throne? A major caveat: there may not really be enough data (given the few people who’ve sat on the Iron Throne), so I don’t know how accurate a machine learning approach to answering this question could be. That said, it is worth asking who Game of Thrones is really about. And if the amount of time spent on screen is any indicator, Game of Thrones is (so far) the story of Tyrion Lannister and Jon Snow.

We can take that idea one step further (because, why not?) by plotting the slope and y-intercept of each trendline in the graph above (☝️☝️) that shows how long are characters appear in each episode. That gives this scatter plot where markers represent whether a character is alive (circle) or dead (x) and colors represent the last season a character appears in:

Hover over various points in the live visualization to see where different characters fall. And you may also start to notice some patterns; in a very unscientific way, I drew a few boundaries based on my impressions of the characters. All of the dead characters cluster together to the left; that’s expected since they’d have a negative slope by not showing up on screen often post-mortem. The minor characters are bundled in the center; they may have positive or negative slopes, but generally will have quite small y-intercepts. The contenders have presumably all been on screen quite a bit since the beginning (high y-intercept), and that won’t change drastically over time (slope between -2 and 2). And the dutiful servants have tended to become more important over the course of the show (positive slope) and have varying levels of initial importance (a range of y-intercept values).

Now, say what you will, but the two points that (continue to) stand out for me are Tyrion Lannister (top center just to the right of the y-axis) and Jon Snow (far right, halfway up the quadrant). I don’t know what it means that Jon Snow is in the Dutiful Servants cluster (even though he’s an outlier there), but my hunch is that he’ll once-again die (not to be brought back) during the final battles. So that leaves Tyrion Lannister who I think will either be the King/Queen-maker, or will be the King himself. Maybe we’ll learn more in Season 8 about why the dragons took so kindly to Tyrion?

So: King Tyrion of House Lannister, first of his name? A bold prediction, but one as good as any other. We’ll see how the data changes over the course of Season 8. Stay tuned!

Oh, and a Few More Things

Geneaology

The big reveal of Jon Snow’s true identity (birth rite and relations with Daenerys) piqued my interest in visualizing the genealogical trees of the various families of Westeros. However, the majority of the genealogical information available comes from the books since the show doesn’t go too many generations back in time. This data has already been visualized quite exhaustively, so I’m not going to recreate that. I’m not sure whether the underlying data is shared anywhere, but that’d be nice...

Dialogue

Scripts from Game of Thrones (and other shows) are available on some online forums. I may one day add dialogue to the episodes dataset, but that’ll be a pretty massive undertaking...

Other Shows

There’s no reason the visualizations above wouldn’t also work for other shows. As a proof of concept, I’ve applied the same code to another custom dataset I’ve made for Netflix’s Stranger Things. It’s worth noting, however, that not all shows will have the same range of data available or suitable geography to do every visualization.

I was also made aware of Amazon’s X-ray data, and have used that data (without modification) to build several similar visualizations for The Man in the High Castle, but again, that dataset doesn’t include things like geography, so not every visualization is possible. Here, it’s worth noting that Amazon X-ray data isn’t perfectly clean/consistent, so it requires cleanup of things like character names and intro sequences. My hope for these visualizations is that they’ll work on any show where Amazon X-ray data available.

Ideas?

I hope you’ve enjoyed exploring these various Game of Thrones data visualizations. If you have ideas for others or improvements, please leave a comment. Thanks for reading!