Now writes plot to file