-2

There is a for loop in my code to go through each data file, and codes to analyze the data(plotting graphs), and then add graphs to the doc file. The doc file always contains previous data's analysis results(the graphs), which isn't what i want. I want the doc file just contains one data's files analysis result. But i don't know the reason. Asking for help? Thanks.

Roy_San
  • 3
  • 1
  • How can we solve a problem like this without any code? Please read and abide by the instructions on creating a [mcve]. – AMC Nov 14 '19 at 04:20

1 Answers1

0

It's difficult to answer without seeing your code snippet. However, I suspect that you create the doc file outside your for loop. So, after each iteration, you add graphs to the old doc file?

You probably need to create a new doc file inside your for loop.

Nathan
  • 471
  • 2
  • 12
  • Hi Nathan, you suspicion is exactly right. i move the doc-creating code inside the for loop and my problem is perfectly solved. Thanks very much. – Roy_San Nov 14 '19 at 05:51