Removing the graph before redrawing