Updated to work with matplotlib 1.3.1