Animated map of earthquakes near China and Japan, 1970-2013


If you prefer, you can watch this as a GIF or on YouTube.

The animation above shows all earthquakes with epicenters in the bounded area and magnitudes greater than 5.0. The first slide says "Richter scale" because that's most familiar to most people, but the actual scale used was the Moment Magnitude Scale; it's generally within a few decimals of the 1930s-era Richter.

The data is from IRIS (the Incorporated Research Institute for Seismology), the maps were produced using Python with Pandas, Matplotlib and Basemap, and the animation with GIMP and HTML5 conversion with gfycat.

The width of the circles is the result of a compromise relationship between magnitude scale number, circle area, perceived circle size difference and total energy release. I chose a scale that (a) was intermediate between the extremes of size every approach suggested, and (b) had a simple formula so that it would be, at the very least, transparent:
circle size = 20 pixels * (magnitude - 4.5) ^ 1.5
As you can see, it's arbitrary, but there is no non-arbitrary scale that is not equally misleading in certain respects, which is probably why IRIS does not vary the circle size at all in their maps, instead indicating intensity with color (which has its own perceptual issues, unfortunately: pdf).

The main thing to note is that the circle size is somewhat related to the area on the surface affected by the earthquake, but the relationship is very fuzzy. Different geographical features affect the distance earthquakes travel; faults, for example, actually contain them in a smaller area. In the animation, the most important difference in scale to show is that earthquakes of magnitude 5.0, which can be felt and are alarming but generally cause little damage in areas prepared for them, are small circles, and the 42 quakes with magnitude 7 or above are quite perceptually different.

Feel free to disagree and comment. As usual, I don't claim to have found the solution to a quandary, just a solution, and I'm sure there are better ideas out there.

As you watch the animation, you may want to keep an eye out for the following notable earthquakes (and you'll also notice a lot of large earthquakes that are not notable, because thankfully the damage they caused was not in proportion to their magnitude).

 • July 1976: The Tangshan Earthquake (magnitude 7.5) on the northern Chinese coast near Korea. The deadliest earthquake of the 20th century, killing between 250,000 and 650,000 people.
 • January 1995: 7.3 The Great Hanshin Earthquake (magnitude 7.3) near Kobe in southern Japan, caused $100 billion in damage, 2.5% of Japan's GDP at the time
 • September 1999: The 9/21 Earthquake (magnitude 7.5) in Taiwan (at the very bottom edge of this map)
 • May 2008: The Great Sichuan Earthquake (magnitude 7.9) in central China, killed 70,000
 • March 2011: The Tōhoku earthquake (magnitude 9.0) and tsunami, the fifth largest earthquake in modern times; hundreds of huge aftershocks appear on the map all the way through December 2013.

Apparently it's a controversial... area.

I'm a Canadian. I'm proud to be a Canadian. I'm proud of my fellow Canadians. But gee whiz, we can sure be sensitive sometimes.

In my post two weeks ago, I pointed out how the Mercator projection exaggerates the surface area of Canada. Map-lovers loved my post; Canadians hated it. Many seemed to think I was trying to cast aspersions on Canada's proud place as the world's second-largest country.

Far from it. But as big a fan of Canada as I am, I'm also a fan of the truth: it's a tight race for second place. If we lost Labrador, we'd drop to fourth. This fact is rather disguised by the Mercator projection:



Poor China, they really get the shaft: they drop a place and end up looking a third as big in relation to their Russian neighbours. The United States is partially buffered from this ignominious fate by Alaska.

I understand why Google Maps uses Mercator: having north, south, east and west perfectly correspond to the edges of the map is handy when you're giving directions. Plus equal-area projections (there are many different ones, because there are many different ways to do this) just look weird, with their elongated, phallic Africa:


There are hybrid projections that do a pretty good compromise, but most of the best ones aren't rectangular, and that can be inconvenient if you don't happen to have, say, a hexagonal iPhone screen.

There. Go Canada. You're big, but my favourite fact about you is that you share the world's largest undefended border. Well, that and the fact that we have the world's largest island inside a lake inside an island inside a lake.

Oh, one more thing: Relevant xkcd.

Canada: strong and free, but maybe not as north as you think

Canada is farther north than the United States: everybody knows this, and for the most part it's true. An article in Monitor on Psychology says people tend to take these geographical mental shortcuts too far: most Americans are surprised to find that all of Florida is farther south than the Mexican border, for example.

So let's see how much of the United States is below Canada's most southerly city, Windsor, Ontario (I won't cheat and count the little islands in Lake Erie that belong to Canada):



For the record, the red area comprises 22% of the surface area of the contiguous United States (38% if you include Alaska), and 15% of its population. Windsor is just 25 km further north than the California-Oregon border.

The paper also states that both Americans and Canadians tend to imagine Europe more southerly than it is in relation to them (they equate Spain's latitude with the southern states, for example). Let's have a look, without that pesky Atlantic Ocean in the way:



Once again using the online tool Mapfrappe, I've marked the Latitudes of Windsor and of the 60th parallel, which divides the Prairie provinces from Northern Canada. You'll notice Windsor, which has some cold winters, is even with northern Spain, which decidedly doesn't. That's another mental shortcut we all share: north = cold, but it's not that simple when you have a nice Gulf Stream warming your coastline.

The geographical comparison was less surprising to me than the demographic one. Six weeks ago, I posted a blog about Canadian population by latitude, whose data was a little coarse because Canada Post and Statistics Canada have copyrighted the most finely detailed geographical boundaries used in the census. A wonderful reader pointed me to the ISLCP II Project, which lists the population of the entire planet for every quarter-degree of latitude and longitude -- albeit from 1995, but I'll take it. Have a look at the relative* populations by latitude of the United States, Canada and Europe:



The most northerly Canadian city with over half a million population is Edmonton, Alberta: it's at about the same latitude as Dublin, Manchester and Hamburg, and 15% of Europeans live farther north than this. (The demarcation of Europe and Asia is fuzzily defined; I chose it as including Istanbul and Moscow, which is north of Edmonton.) And the median latitude of population in Europe is 7 degrees higher than in Canada -- that's over 800 kilometers.

Thanks to these histograms I realized I'm as susceptible to that misfiring geography heurism as anyone: in my mind, Hawai'i was about the same latitude as Sacramento, California, but it's over 500 kilometers farther south than the mainland United States.

Next week, I finish my latitudinal triptych with some sundry interesting tidbits I picked up while writing the last two.

*That means all the bars in each column add up to 100% of the population of the area; obviously, there are more people in Europe and the United States than in Canada.

Canada and the Mercator Projection: Latitude and Attitude

This post owes its existence to the excellent online tool MAPfrappe, which allows you to draw on a map of the Earth and then move it around; you can save your drawings, such as my outline of Canada. It took me a while to do, please feel free to play around with it to validate the time I spent judging how close to the squiggly borders was close enough!

Google Maps is a truly wonderful invention, but there is one flaw: the Earth is a sphere, and in order to fit it on a rectangular surface (like a computer screen), adjustments must be made. Google uses the Mercator Projection, which dates all the way back to 1569. It's famous, it's familiar, but there are many better ones.

The main weakness of Mercator is its exaggeration of surface area the closer you get to the poles; and of course Canada gets pretty close to the north pole. Compare the Mercator projection of Canada with an image from a globe: Ellesmere Island, the northermost landmass, has over four times more area in the Mercator projection!


Mapfrappe allows us to see what happens to the outlines when we move them elsewhere in the map projection. Canada extends from latitudes 42.3°N (Windsor, Ontario) to 83°N (the northern tip of Ellsemere Island). So let's drag the map so that the northern tip of Ellesemere is now at 42.3°S:


Wait a minute, the sharp-eyed among you may now be objecting. Something's wrong with this map! Windsor projects below the South Pole! How can anything be below the South Pole? And Canada's longitudes, which Mercator is not supposed to affect, have been drastically increased: the country now spans over 90% of the globe! You're seeing an artifact of geometry: MAPfrappe does not recalculate the projection of every point of the outline (which would be a very computationally comlex thing to do for what is essentially a whimsical exercise), it trapezoidally skews the projection according to its center. (I may be using the wrong terms to describe this: I'm a biochemist, not a mathematician.)

Who cares if parts of the globe where few people live are distorted in the Mercator projection, you may ask. It's a valid question. I'll just leave you with this: a comparison of the size of Canada with that of Africa on the Mercator projection (even leaving out the most northerly part) and on the globe. I think it's plausible this illusion may affect opinion and policy.




 Next week: I take even more latitude with latitude.

Population of Canada by latitude



Update: here's my final edit of the chart; I think the city labels are much less misleading now. I've come across a much more fine-grained data set, albeit from 1995; you can see it in my Nov. 27, 2013 blog post.



Here's the original, which seemed to imply that the bars were only made up of population from the indicated cities, whereas the bars indicate the population of the entire country at the same latitude of those cities:



A co-worker and friend happened to mention that Vancouver was further north than Montreal; I sort of knew that, but I was surprised to find out it was 400 km further north. So I was curious, and tried to find a histogram of Canadian population by latitude; maybe my Google fu was lacking, but I couldn't find one, so I decided to make one myself.

Little did I know what I would discover; that data is not easy to obtain. There is lots of population data available for download from the Statistics Canada website, but it does not contain geographical coordinates, and StatsCan uses its own defined areas called census subdivisions. They have available for download geographical boundary files, but they would have required an amount of computation rather disproportionate to the task of simply determining latitudes.

Luckily, StatsCan also makes the population available by Forward Sortation Area, the first three letters of the Canadian six letter postal code, e.g. the FSA of the Canadian parliament at postal code K1A 0A9 is K1A. So now it was just a matter of finding out the latitudes of FSAs or postal codes. Simple, right?

Wrong. Canada Post considers its postal codes intellectual property subject to copyright; a license to use and analyze it costs $892 a year for StatsCan's info, and over $5000 for many business products. They are suing a website for providing information on postal code geography. Universities used to be able to access Canada Post's geographical data, but no longer. I work for a university, and the reference library has someone who is able to take the publicly available ArcGIS files and determine the centroids using the expensive proprietary commercial software for which the university has a license.

So: the population data is divided into 1600 FSAs, which is pretty decent resolution. The centroid (geographical center) for most postal codes fits reasonably well within the 0.5 degree latitude (about 55 km) resolution of the graph, except of course for the very large FSAs the farther north you go. But in any case, these areas would have had to be aggregated somehow to even be visible on the scale (for example, if if the northernmost FSA, X0A, were spread out among its 14 degrees of latitude), so I think this is a reasonable compromise.

A note on the city labels: I tried to give the largest municipalities that contributed to the population in each bar of the histogram as an aid to understanding, not as a systematic data set. This became difficult for some of the larger FSA's; it was difficult to match the latitude of a town with the latitude of the centroid of its FSA. So in some cases, I may have used a town with a population of 2,000 when there was a town with 3,000 people at the extreme north or south of the FSA. And a note about Edmonton: it straddles two bars because the center of the city is almost exactly on the demarcation, 53.5 degrees north. Edmonton is a bit smaller than Calgary, but there are other sources of population in each latitude than the city mentioned, so do not draw the wrong conclusion from the size of the bars.

You can peruse the data I used in this Google Doc.

Comments are welcome, even, nay especially, critical ones.

EDIT 2013-10-16 14:49 GMT: Montreal straddles the 45.5 degree latitude, and by marking the 45.5-46.0 bar as "Laval", the graph appeared to be indicating that Laval had a larger population than Montreal. I've explained how the labels are generated, but it's an obvious conclusion to draw from a glance at the map without reading the methodology (and the methodology had to be tweaked for Edmonton and Montreal, which straddle the cusps of the graphs, and the centroids of the FSAs are problematic to begin with). Clarity is the most important thing, so I've updated the bar to read "Laval & Montréal". Thank you to the commenters in Reddit's dataisbeautiful forum for pointing this out.

EDIT 2013-10-16 15:33 GMT: When you're wrong, you're wrong, and I was wrong. My labels were utterly misleading. Now I have put the major contributor AND every Canadian city with over 100,000 population on the graph. I had intended the labels just as a geographical reference, but I definitely did not think through what fresh eyes coming to the graph would think.

EDIT 2013-10-16 21:53 GMT: These labels are really getting me in trouble. I produced the graph first without them, but I envisaged a torrent of "You should have indicated where these people live!" I've removed the most northerly ones, because again, they're misleading. Lesson learned: less is more.

EDIT 2013-10-16 22:41 GMT: Added hi-res version without labels. I think that's enough editing today. Enjoy! And thanks for all the feedback! The vast majority of it was very constructive, it's appreciated.