Add support for '~' in path. Thanks to Sally Warner for suggesting this.
Merge branch 'master' of https://github.com/ojwoodford/export_fig