reprocess data for plotting figures