storing plot data in file