savePlotToFile function

Save a plot in some way