finish drawing the result and save the distribution and assignment graph to png file.