Plotting data on maps with matplotlib

I’m learning about matplotlib, and actually just bought the book Matplotlib for Python Developers.

Geographical plots

Browsing stackoverflow, the matplotlib homepage, and other resources, I eventually came by this stackoverflow post, which mentions BaseMap. Since the data that I’m plotting is inherently geographical, it makes sense to show the data on a map.

There are several nice examples on the basemap Github page.


Often I want to create heatmaps of the data, using matplotlib.

On stackoverflow there are several posts on this topic:

There are different colormaps available for matplotlib, if you want to try different colorschemes.

How to install gfortran on Mac OS X

Why did I install gfortran? Well, not to write Fortran programs. I tried installing SciPy using pip install scipy, and I got a message that a Fortran compiler was needed.


This is how I installed gfortran on my Mac:

Visit, and select a binary distribution for your version of Mac OS X, e.g. gfortran-snwleo-intel-bin.tar.gz for Snow Leopard.

Continue reading “How to install gfortran on Mac OS X”

Simulating the Golden Balls game show

In this eposide of Golden Balls, an inspired event takes place:

I retold the event at DIKU APL lunch (nice to have a job where game theory is a valid conversation topic), and we had a conversation about it. At first I thought this was prisoners dilemma, but it was quickly revealed that it is a different game. What is cool about it is, that Nick basically forces Abraham to pick split. I don’t think the same approach would work again though. The person in Abrahams position might be tempted to try a counter-steal. The person in Nicks position might be tempted to actually steal the money, which would be a dirty thing to do, but not completely unlikely.

Continue reading “Simulating the Golden Balls game show”