Fixing matplotlib.pyplot usage when DISPLAY is not defined

On systems like compy, the variable `$DISPLAY` is not defined, which makes matplotlib.pyplot to fail. The solution is to use Agg, a non-interactive backend for matplotlib (as it is used in `make_2d_plots.py`).