new code to prepare the plot from the nbody simluation