saving the coordinates before changing the graph