Set matplotlib to agg mode