Update:

Introduction

If you are a python programmer, you have probably heard of matplotlib. It’s a wonderful tool for data visualization work, but it can be confusing to work with at first. This tutorial introduces the Basemap library, which can be used to create maps and plot geographical datasets.

The main goal of this tutorial is to help you get comfortable making maps of geographical data. If you follow along with the tutorial, you will end up making this map:

A map of the world’ most recent earthquakes, of magnitude 1.0 or greater. The magnitude of each earthquake is represented by dot size and color.

It takes fewer than 50 lines of code to generate this map from a raw dataset! This tutorial concludes with a listing of datasets to explore.

A short, annotated list of data sets to explore with your new mapping skills

One of my goals in writing this tutorial is to help high school students apply their interest in programming to their core academic subjects. If you are a high school student, please consider using this technique to create a visualization for one of your classes, that none of your non-programming peers could even consider making. You will probably impress your teacher, you will get to use programming in one of your required classes, and you will certainly learn some interesting things in the process.

Whatever your motivations are for learning about mapping, I hope this tutorial helps you understand how to use matplotlib’s Basemap package a little better. Thank you to the folks who have made these resources available to all of us!