PreparePlotData function

Prepare plot-level data