Fix for matplotlib not connecting to a display.

Toggle plt.ioff everywhere before plotting.