ggplot in a loop

If you are using a for loop to output multiple plots, ggplot doesn't work.