Implement workaround for matplotlib 1.4.2 bug

This is an unpleasant hack, but this is also a nasty bug and matplotlib apparently won't be releasing a fix for a few months: https://github.com/matplotlib/matplotlib/pull/3699

This closes #344