capturePlot function

Captures a plot such that it can be redrawn later/elsewhere