Visualizing Population Change

The Slope Graph

Every time I’ve visited Newfoundland and Labrador I’ve loved it. So, when I hear about the shrinking of small towns there my ears perk up. I thought it would be interesting to visualize the change in communities of all size across all provinces between 2001 and 2016. There are many ways to look at this, here are two. In this post I use the term “city” and “community” interchangeably.

First, a table. Unlikely the first thing to come to mind when thinking data visualization, but not everything has to be New York Times quality D3 animation to enlighten.

Number of Communities
Province Decreasing Increasing
British Columbia 226 288
Alberta 103 248
Saskatchewan 507 344
Manitoba 38 117
Ontario 145 291
Quebec 482 550
Nova Scotia 52 34
New Brunswick 178 75
Prince Edward Island 62 48
Newfoundland and Labrador 273 70
Yukon Territories 8 17
Northwest Territories 11 12
Nunavut 4 20

Here, I’ve used R to add shading, colour and bars that indicate the number of growing or shrinking cities out of all the cities in that province. I’ve also added a multi-row header and wrapped the text around the table as you’d see in a newspaper. The provinces and territories are grouped geographically so it’s easy to spot the Maritimes and Newfoundland and Labrador in orange. But I hadn’t heard anything about Saskatchewan until I made this chart. Good thing the CBC was all over it.

Although not essential for this task, the bars and colouring are programmatic. If more than 50% of the cities in a region grew or shrunk then the colour bar gets darker. Same again at 75%. Which got me thinking about this post I read recently about Microsoft Excel and the era of big data.

I think the addition of colour and bars adds visual interest to what are traditionally dry and uninteresting tables. Still, we can’t differentiate between small towns and big cities. Enter, the slope graph.

This grid gives every province its own slope graph with just two dates 2001 on the left and 2016 on the right. Falling populations are indicated with thin red lines, growing ones in black. Most of the slope graphs I’ve seen have just a few lines. In most of the cases here there are hundreds.

I started this project thinking about Newfoundland and Labrador. Their graph, with its dense swath of red, is a powerful representation of the problems they face. Whereas Manitoba, Alberta, and Nunavut have growing cities across a wide range of population sizes.

I find these slope graphs quite pretty. Abstract art almost. Here’s a larger look at beautiful B.C.

R Markdown is pretty neat. You can do things like this . I wonder why more people don’t do this. It’s so much easier to read NOTE: Those people live here