title: Generate multiple plots with for loop; display output in matplotlib subplots
body: <p><strong>Objective</strong>: To generate 100 barplots using a for loop, and display the output as a subplot image </p>
  
  <p><strong>Data format</strong>: Datafile with 101 columns. The last column is the X variable; the remaining 100 columns are the Y variables, against which x is plotted.</p>
  
  <p><strong>Desired output</strong>: Barplots in 5 x 20 subplot array, as in this example image: <a href="https://i.stack.imgur.com/XXuOx.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/XXuOx.jpg" alt="Subplot - 3 x 2 array example"></a></p>
  
  <p><strong>Current approach</strong>: I've been using PairGrid in seaborn, which generates an n x 1 array: <a href="https://i.stack.imgur.com/H17g8.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/H17g8.jpg" alt="example output"></a>. </p>
  
  <p>where input == dataframe; input3 == list from which column headers are called:</p>
  
  <pre><code>for i in input3:
      plt.figure(i)
      g = sns.PairGrid(input,
               x_vars=["key_variable"],
               y_vars=i,
               aspect=.75, size=3.5)
      g.map(sns.barplot, palette="pastel")
  </code></pre>
  
  <p>Does anyone have any ideas how to solve this?</p>