I need to make a series of plots and save them in a directory. using a for loop, in every iteration I create a new plot and I use savefig to save it. The code is as follows