Porting matlab/make_plots.m to python.