savePlot function

Save a plot