rearrange plot data