using matplotlib with Agg so that we don't need an X server