title: How to separately plot and save to figure from multiple files using glob and matplotlib?
body: <p>I tried to plot multiple files then save it separately with this code:</p>
  
  <pre><code>import pandas as pd
  import matplotlib.pyplot as plt
  
  
  filenames = sorted(glob.glob('./CSV/*.csv'))
  for f in filenames:
      print(f)
      df = pd.read_csv(f, delimiter=',')
  
      plt.plot(df['Date'], df['step'], color="orange")
      plt.xticks(rotation='vertical')
      plt.xlabel('Date and time')
      plt.ylabel('No. of steps')
      plt.grid(True)
  
      plt.savefig(f'{f[:-10]}-.jpg', bbox_inches='tight')
  </code></pre>
  
  <p>But the result will be several plot in one png/jpg file. For example from 3 files:</p>
  
  <p><a href="https://i.stack.imgur.com/iz4zP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iz4zP.png" alt="enter image description here"></a></p>
  
  <p>What should I add to make separate plot and save each plot as several files?</p>