swapped displaying and saving

now the file will be saved before displaying the image. Exiting the
program before the program finished saving the .gif for the animated 1d
graph created unfinished gifs which ended too early. now, you know it's
safe to end the program if you can see the graph.

replaced the bad .gifs in samples/